Commit Graph

4828 Commits

Author SHA1 Message Date
zurdi
682e06c2f6 fix(v2): tidy the files-tab selection actions and add per-row delete
The selection actions become icon-only (download, copy link, delete, clear)
so they sit on the checkbox row instead of wrapping off-screen on narrow
viewports, and each file row gains a delete button gated on the delete grant.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WbesTQXohyAWWcLV5iiEN
2026-09-03 17:15:34 -04:00
zurdi
d09016a485 refactor(upload): keep the start headers and take the rom target as a JSON body
`POST /api/roms/upload/start` keeps its X-Upload-* headers so existing
clients are unaffected; the new rom_id and folder travel in an optional
JSON body instead of extra headers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WbesTQXohyAWWcLV5iiEN
2026-09-03 17:15:34 -04:00
zurdi
452f0a41de refactor(upload): take the chunked upload start fields as a JSON body
`POST /api/roms/upload/start` reads platform_id, filename, total_size,
total_chunks and the optional rom_id and folder from a JSON payload instead
of X-Upload-* headers. Header values are limited to ISO-8859-1, which also
rejected non-Latin filenames in the browser.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WbesTQXohyAWWcLV5iiEN
2026-09-03 17:15:34 -04:00
zurdi
bdaee9d0f0 chore(review): apply review polish to comments and tests
Drop em-dashes from the new comments, hash with usedforsecurity=False in
tests, and replace double type assertions with typed factories.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WbesTQXohyAWWcLV5iiEN
2026-09-03 17:15:34 -04:00
zurdi
a29d875b9d i18n: add files scan and folder upload strings
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WbesTQXohyAWWcLV5iiEN
2026-09-03 17:15:33 -04:00
zurdi
af57e8d574 feat(v2): refresh files scan and uploads into rom folders
Adds the files scan to the scan launchers and a direct "Refresh files"
action in the game menu, shares the socket trigger between them, refetches
the open game when a scan finishes, and routes every Files tab upload
through the chunked upload with a destination dialog for new folders.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WbesTQXohyAWWcLV5iiEN
2026-09-03 17:15:33 -04:00
Georges-Antoine Assi
97a16e2c79 refactor: tighten comments and tests on the sigil branch
Reverts the FileRow hash-chip loop. It was left over from the per-file
version chip that no longer exists, so it is unrelated to title ids.

Cuts the comments that restate the code or defend an obvious choice, and
the `Args:` block on `get_matching_missing_rom` that repeated its own
parameter names. The CNMT content-type rationale now lives only on
`CONTENT_TYPE_CATEGORIES`.

Tests exercise the production path: the title id regex is checked with
`fullmatch`, the way the caller uses it, and `test_identity` builds its
auth header the way every other endpoint test does.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-02 17:13:20 -04:00
Georges-Antoine Assi
7036ae0e9c Merge remote-tracking branch 'origin/master' into feature/sigil-title-ids 2026-09-02 16:34:48 -04:00
Georges-Antoine Assi
bcafc3d504 refactor(scan): tighten the sigil title id plumbing
Rename embedding now goes through the handler's own rename primitive
(`rename_fs_rom`), so it inherits the library-root path validation and
per-path locking every other write in that class gets, and builds the new
name with the repo's multi-part extension helpers.

Extraction no longer reads files it can never parse: archives, manuals,
soundtracks and screenshots are skipped, and on non-Switch platforms it
stops after the first result, since only Switch looks at a per-file
content type.

Also collapses the two rom-level branches (dropping a closure), gives the
Switch family one home in RomM's own terms instead of deriving it from
sigil's slug string, logs an unrecognized save target layout instead of
dropping it silently, deletes the `ScannedFSRomValues` mirror of `FSRom`,
drops a dead `rom.version` locale key, and slims the sigil Docker builds
to one layer with a filtered clone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-02 16:34:36 -04:00
Georges-Antoine Assi
8cae30a51d chore(steam): point the logo references at the PNG
Follow-up to the asset swap: the code still pointed at steam.svg.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-02 15:38:32 -04:00
Georges-Antoine Assi
50b03f8cc7 refactor(steam): drop redundant work found in review
Remove the roms_facets backfill from 0115: the steam columns are created by
that same revision, so it was a full-table UPDATE writing NULL over NULL at
container start. Migration 0114, which adds provider columns the same way,
has no backfill either.

Collapse the nine hand-written raw_*_metadata blocks in updateRom into a loop
over raw_metadata, so a new provider no longer needs a copy-pasted block.

Reuse the shared disable_metadata_rate_limiters fixture for the Steam adapter
tests instead of a second local one, move STEAM_PLATFORMS up to the constant
block it belongs to, and trim a test docstring that restated the rationale
already sitting next to resolve_steam_rom.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-01 17:05:18 -04:00
Georges-Antoine Assi
a7a15754b0 Merge remote-tracking branch 'origin/master' into claude/steam-metadata-provider
# Conflicts:
#	backend/config/__init__.py
#	backend/config/config_manager.py
#	backend/endpoints/heartbeat.py
#	backend/endpoints/responses/heartbeat.py
#	backend/endpoints/responses/rom.py
#	backend/endpoints/roms/__init__.py
#	backend/handler/database/roms_handler.py
#	backend/handler/metadata/__init__.py
#	backend/handler/scan_handler.py
#	backend/models/rom.py
#	backend/tasks/scheduled/scan_library.py
#	backend/watcher.py
#	env.template
#	frontend/src/__generated__/models/Body_update_rom_api_roms__id__put.ts
#	frontend/src/__generated__/models/DetailedRomSchema.ts
#	frontend/src/__generated__/models/MetadataSourcesDict.ts
#	frontend/src/__generated__/models/SimpleRomSchema.ts
#	frontend/src/locales/bg_BG/settings.json
#	frontend/src/locales/cs_CZ/settings.json
#	frontend/src/locales/de_DE/settings.json
#	frontend/src/locales/en_GB/settings.json
#	frontend/src/locales/en_US/settings.json
#	frontend/src/locales/es_ES/settings.json
#	frontend/src/locales/fr_FR/settings.json
#	frontend/src/locales/hu_HU/settings.json
#	frontend/src/locales/it_IT/settings.json
#	frontend/src/locales/ja_JP/settings.json
#	frontend/src/locales/ko_KR/settings.json
#	frontend/src/locales/pl_PL/settings.json
#	frontend/src/locales/pt_BR/settings.json
#	frontend/src/locales/ro_RO/settings.json
#	frontend/src/locales/ru_RU/settings.json
#	frontend/src/locales/tr_TR/settings.json
#	frontend/src/locales/zh_CN/settings.json
#	frontend/src/locales/zh_TW/settings.json
#	frontend/src/services/api/rom.ts
#	frontend/src/stores/heartbeat.ts
#	frontend/src/v2/components/EditRom/MetadataIdSection.vue
#	frontend/src/v2/components/GameDetails/RelatedGameCard.vue
#	frontend/src/v2/components/GameDetails/providers.ts
#	frontend/src/v2/components/Scan/ScanInfoDialog.vue
#	frontend/src/v2/utils/metadataProviders.ts
#	frontend/src/v2/views/Settings/ScanSettings.vue
2026-09-01 16:49:24 -04:00
Zurdi
475340bce8 Merge pull request #4303 from sdornan/claude/handoff-romm-fixes-58e484
fix(logs): stop a multi-line record painting over the rows after it
2026-09-01 12:41:47 +02:00
Zurdi
179b202da7 Merge pull request #4315 from tmgast/fix/manual-upload-assets-path
fix(manual): only ask where a manual goes when the answer is open
2026-09-01 12:32:16 +02:00
Georges-Antoine Assi
d1204e36de revert(frontend): drop the scene id fields from the v1 edit dialog
Last of the accidental v1 edits. v2's MetadataIdSection already offers
the three fields through its FIELDS array and routes them via
parseSceneId, so nothing is lost. Restores the file to its state on
master, which also drops an unrelated parseInt radix/NaN tweak that
belongs in its own change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-31 21:42:25 -04:00
Georges-Antoine Assi
3ef82470d9 revert(frontend): drop the scene sources from the v1 settings view
Same accident as the setup view: v1 is frozen and v2's Settings metadata
view already lists Demozoo, Pouet and CSDb, with the website and docs
links v1 has no field for. Restores the file to its state on master.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-31 21:41:08 -04:00
Georges-Antoine Assi
e8b07b45b1 revert(frontend): drop the scene sources from the v1 setup view
v1 is frozen; the three sources were added to the classic setup step by
accident. v2's SetupStepMetadata already offers Demozoo, Pouet and CSDb,
so this restores views/Auth/Setup.vue to its state on master.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-31 21:37:32 -04:00
Georges-Antoine Assi
b07afa7e02 i18n: translate the Demozoo, Pouet and CSDb strings
The new provider keys landed as English text in every locale, and the
metadata-specialised-hint edit that added "demoscene" was only carried into
de_DE. Translate both, following each locale's existing conventions for
provider id labels and the demoscene term.

Values that stay identical to en_US are deliberate: locales that render every
provider id as "X ID" keep that form, and the languages that use "demoscene"
as a loanword keep it untranslated.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-31 20:59:23 -04:00
nendo
fd42387652 fix(manual): keep a manual dropped during an upload
Each upload now carries its own ROM and files rather than reading them
back off refs a later drop has already overwritten, and uploads run one
at a time, so a second manual queues instead of being discarded when the
first completes. The dialog no longer disables itself while an upload
runs, since a choice made then simply joins the queue.

The two upload branches differed only by endpoint and message keys, so
they collapse into one table.
2026-08-31 13:14:26 +09:00
nendo
7e5add7042 fix(manual): only ask where a manual goes when the answer is open
Uploading a manual to a single-file ROM warned that it would be
irreversibly converted to a folder ROM, but the dialog already sent such
a ROM straight to the resources path without opening, so the warning
preceded nothing. A ROM that already keeps manuals in its folder now
appends there without asking too, leaving the dialog for the one case
where the destination is still undecided.
2026-08-31 13:01:47 +09:00
nendo
e04b6035f2 Merge upstream master into feature/sigil-title-ids
Upstream took 0113, so the sigil migration rechains onto
0113_roms_locked_fields as 0114. The sigil build stage keeps its place
ahead of the emulator stage, which upstream renamed for js-dos.
2026-08-31 11:39:53 +09:00
nendo
48d48b152f feat(roms): accept binary identity from a client
RomM reads a ROM's identity during a scan wherever it can open the file.
An encrypted Switch dump it cannot, and the keys that would open it stay
off the server, so a client holding them can PUT what it extracted under
roms.write. A Switch update or DLC id resolves to its base first, since
reassociating a renamed non-hashable ROM matches on that field and an
update id there would strand the entry.
2026-08-31 11:20:19 +09:00
Georges-Antoine Assi
fc46c3eb1c Merge branch 'master' into feat/demozoo-pouet-phase0
Renumber the two migrations onto master's head: 0108/0109 collided with
0108_roms_primary_region and 0109_rom_files_category_index, leaving the
chain with two heads. They are now 0114 and 0115 behind 0113.

Both rebuild the roms_facets sync triggers from a hardcoded column list,
so add the publishers and developers columns 0112 introduced. Without
them the rebuilt triggers would have silently stopped mirroring the two.

Adopt master's provider taxonomy. METADATA_PROVIDER_GROUPS now carries
demozoo, pouet, and csdb as catalogs, which replaces the branch's own
GENERAL_PROVIDER_KEYS set and feeds the setup wizard, the scan dialog,
and Settings from one registry. CSDb reaches the scan explainer for the
first time; it was already selectable there.

Regenerate the frontend types: DetailedRomSchema was missing the three
metadata blobs the backend has always declared on RomSchema, and the
blobs are now typed rather than Record<string, unknown>.

Correct the setup strings that still called the three sources enabled by
default, and sort the locale keys.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 21:32:11 -04:00
Georges-Antoine Assi
c0d01c58ee fix(metadata): harden the scene metadata handlers
Security review follow-ups on the Demozoo, Pouet, and CSDb handlers.

Default the three sources to off, matching every other provider. They
were the only ones defaulting to on, so an upgrade began contacting
demozoo.org, pouet.net, and csdb.dk on the next scan with no operator
opt-in, reachable through the unauthenticated metadata heartbeat.

Guard the bare id conversion in scene_id_or_none. str.isdigit() accepts
superscripts and other digits int() rejects, so a pasted "²" raised out
of the Edit ROM endpoint as a 500.

Filter the remote demozoo_url through http_url(). It was the only one of
the three URL fields taking a string from the API rather than building
one from a hardcoded template and an integer id.

Match a YouTube id against an explicit ASCII class. isalnum() is
Unicode-aware, so it accepted ids the embed URL never can.

Stream the CSDb response against a byte budget. The cap ran after the
whole body was already buffered, so it bounded the parse but not memory.

Catch defusedxml's refusals. EntitiesForbidden derives from ValueError
and ParseError from SyntaxError, so the existing handler caught neither
and an entity-declaring document raised out of production_from_xml.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 20:49:14 -04:00
Georges-Antoine Assi
41d2858caf refactor(music): trim comments and give shared values one home
Cuts the multi-line rationale headers down to the one fact a reader
cannot recover from the code, and hoists RECENTLY_ADDED_LIMIT out of
the two views that each declared it into utils/jukebox.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 15:33:05 -04:00
Georges-Antoine Assi
8b3ca227e2 fix(music): shuffle tracks paged into an already-shuffled queue
Reloading the playlist with preserveShuffle kept the existing order but
appended newly loaded tracks in server order, so playback went
sequential once the previously loaded window ran out.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 15:25:07 -04:00
Georges-Antoine Assi
e4bf57643b fix(music): refetch browse-mode lists after a track is deleted
The host bumps refreshToken after a delete, but BrowseMode only watched
the selection, so the deleted track stayed visible and playable. The
sidebar reloads too since a delete changes its counts and can empty the
picked entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 15:25:05 -04:00
Georges-Antoine Assi
414dea2b49 Merge remote-tracking branch 'origin/master' into agent/jukebox
# Conflicts:
#	frontend/src/stores/soundtrackPlayer.ts
#	frontend/src/v2/components/GameDetails/MediaTab.vue
#	frontend/src/v2/components/GameDetails/SoundtrackPanel.vue
2026-08-30 15:16:45 -04:00
Georges-Antoine Assi
8029ffed2c refactor(music): review cleanup across the jukebox branch
Consolidates the three copies of the track-time formatter into a shared
formatTrackTime util (Intl.DurationFormat can't match the "2:37" format,
its digital style always pads minutes), points the six private copies of
the axios errorMessage helper at the shared util (MediaTab's was dead
code and is just removed), drops the legacy ?mode= redirect since the
jukebox never shipped with query-based modes, shrinks the free-radio
sample from 1000 tracks to the 200 that comfortably fill an hour, and
prunes redundant comments.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 15:05:21 -04:00
Georges-Antoine Assi
ad44d970dd style(music): neutralize the jukebox launch tile medallions
The per-tile color tints made the landing read as rainbow noise; the
icon medallions keep their shape but use the standard surface, border
and heading colors instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 10:57:21 -04:00
Georges-Antoine Assi
92ebfd8f8e fix(music): keep the player on screen when a queue is empty
An empty result no longer swaps the whole soundtrack panel for a
full-screen empty state: the panel stays up with its art placeholder
and transport, and only the queue area shows the "no results" box.
Browse modes pass their facet icon through the new emptyIcon prop.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 10:45:50 -04:00
Georges-Antoine Assi
72a0e2a95b feat(music): name the open jukebox subgroup in the page header
The header now shows the subgroup's name with the back arrow directly
to its left, instead of a floating arrow on the far right. PageHeader
gains an optional prepend slot for it, and the mode display names move
into a shared map so the header and the launch tiles stay in sync.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 10:45:38 -04:00
Georges-Antoine Assi
2bf81798f8 fix(music): give jukebox modes real paths so browser history works
The browse mode moves from ?mode= to a path segment (/music/:mode?)
written with router.push, so every subgroup is its own history entry
and back/forward walks between them. Selections inside a mode stay in
the query via router.replace so refining a pick does not spam history.
Legacy ?mode= links are honored on entry and rewritten to the subpath.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 10:29:13 -04:00
Georges-Antoine Assi
af97973733 feat(music): redesign the jukebox player around a now-playing rail
The soundtrack panel gains a wide layout (container query + host opt-in)
with the cover art, a CSS vinyl that slides out and spins during
playback, and stacked transport controls on the left, while the queue
fills the rest of the screen. Track rows drop their per-row borders for
queue numbers, a hover play glyph, equalizer bars on the active track
and an inline favorite button. The launch tiles get color-toned icon
medallions and fill their counts in as each facet query lands instead
of waiting for the slowest one. Clicking the active row now toggles
play/pause, subtitles no longer repeat the album as the game name, and
the artist chip is gone since the artist has its own line.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 10:29:01 -04:00
Georges-Antoine Assi
aaaaf56bd7 fix(music): report the whole queue size, not the loaded page
Since the track lists page in, the panel's header and footer were counting
only what had loaded so far — a platform with 321 tracks read "200 tracks"
next to a sidebar saying 321.

The panel now takes the queue's total and reports that. The running time
stays hidden until every page is in, since only loaded tracks have
durations; short queues that arrive in one page are unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 09:31:45 -04:00
Georges-Antoine Assi
b26c6d38e9 perf(music): page the jukebox track lists in on demand
Play-all and the browse selections still resolved their whole queue up
front, which on a large library meant ~100 parallel /music/tracks
requests before anything rendered.

They now load one 200-track page and fetch the next only as the viewer
scrolls toward the end of what is loaded, or as playback approaches it.
The panel reports the furthest index reached and the new useTrackPager
turns that into at most one in-flight page, dropping any page that
arrives after the selection changed.

getAllFavorites goes away with its last caller; getAllTracks stays for
the one list that is small by construction (a single game's soundtrack).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 08:35:40 -04:00
Georges-Antoine Assi
dc22c2239c refactor(music): serve jukebox browsing from the API
Addresses the deeper issues left open by the previous cleanup pass: the
jukebox downloaded the whole track catalog on mount and re-derived every
facet client-side, and the view had grown to hold all of that state plus
eight screens' worth of markup.

Backend — close the gaps that forced the client-side grouping:
- filter tracks by the owning game's genre and by a year range
- facet games, platforms and game genres, so each sidebar is a paginated
  server query with counts instead of a grouping over the full catalog
- a stats endpoint for the home cards' totals
- game genres are counted per rom then folded in Python, mirroring how
  the ROM filters aggregate their JSON arrays

Frontend:
- Jukebox becomes a shell over HomeMode / BrowseMode / SessionMode; the
  five browse dimensions share one component and differ only by the facet
  they load and the filter they pass
- the soundtrack panel takes one normalized PanelTrack[] instead of a
  rom-or-catalog prop union, and moves to components/Soundtrack/
- its track list is virtualised, so rows (and their menus) scale with the
  viewport rather than the library
- favorites move into a store, ending the four-way hand-fanned copies
- new composables for rom soundtracks, delete confirmation and URL state
- CardRow moves to shared/; platform and jukebox tiles share one Tile
  composite instead of two copies of the same chrome

Also fixes a viewer-permission test that the jukebox's PLAYLIST_EDIT
action key had been failing since it was added.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 08:18:41 -04:00
Georges-Antoine Assi
974b2a4be7 refactor(music): simplify jukebox and share duplicated helpers
Quality pass over the jukebox feature: extract helpers the diff had
duplicated, collapse copy-pasted template blocks, and remove wasted work
on paths that run per render or per keystroke.

Reuse:
- share shuffled() from utils instead of two Fisher-Yates copies
- add v2/utils/errorMessage.ts and v2/utils/jukebox.ts so the mode list
  has one owner instead of three hand-maintained copies
- game_cover_url reuses MusicTrackSchema.cover_url_for

Simplification:
- launch tiles and the session-mode ternary become data-driven
- drop unused order options from the music service and the unreachable
  romId fallback in deleteSoundtrack
- extract buildPlayerPayload() from its two call sites

Efficiency:
- count music tracks over a single-column projection
- group tracks with push instead of rebuilding each bucket array
- precompute track rows so the list stops rescanning per render
- page the catalog and the panel's two fetches in parallel
- update a favorite in place rather than rebuilding three arrays
- debounce the search URL write alongside the fetch

Also adds freeRadio tests and fixes a vue-tsc error on route.query.game.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 07:20:51 -04:00
nendo
64a1b57661 refactor(scan): name the save fields for what they address
`save_id` collided with two other meanings in the codebase: `Save` is a
model, and `DeviceSaveSync.save_id` is a foreign key to it. Neither is
what this field holds, which is the on-disk name an emulator gives a
game's saves. It becomes `save_target`, and `save_usage`, which said
nothing about what it decided, becomes `save_target_layout`. Both carry
a `doc=` so the meaning is at hand where the columns are read.

The per-file copies are gone. Nothing read `RomFile.save_id`, and the
per-file `title_id` and `title_version` only fed display chips, while
the category derived from the binary content type is what actually
drives update and DLC behaviour and stays. Save layout belongs to a
game rather than to one of its files, so a client can no longer read a
file's value and build a wrong directory from it.
2026-08-30 13:22:53 +09:00
Sam Dornan
8fced61064 fix(steam): send the Steam ID and raw metadata on save
Edit ROM had a complete Steam UI - an ID field and a raw-metadata tab -
but `updateRom` serializes a fixed field list, and Steam was in neither
it nor the `raw_metadata` type. The endpoint preserves the stored value
for any field the form omits, so both edits returned 200 and changed
nothing.

The raw-metadata half escaped the typechecker because RawMetadataPanel
writes through a computed key, which widens the member type.

Cover the serializer, which had no tests at all: both lists are asserted
per provider, so the next provider to be added fails here rather than
silently dropping saves. Add the matching endpoint tests for the Steam ID
refetch, its disabled-handler path and the clear path, and extend the
unmatch sweep to Steam.
2026-08-29 17:20:40 -05:00
Sam Dornan
b2e3de4772 Merge branch 'master' into claude/steam-metadata-provider
Resolves the additive conflicts against master:

- config, handler registry and the roms endpoint imports keep both the
  Steam and the new UPC-lookup entries.
- Renumbers the Steam migration to 0113 (master took 0109) and rebases it
  onto 0112_publisher_developer_split.
- Syncs the migration's pre-Steam facet mirror list with 0112, which added
  publishers/developers to the roms_facets triggers.
- Groups SteamMetadata's publishers/developers with the shared provider
  keys, now that master has made them a shared field.
2026-08-29 16:36:58 -05:00
Georges-Antoine Assi
c0ab254c59 Merge pull request #4077 from Spinnich/fix/missing-firmware-cleanup
feat(firmware): let missing firmware be found, cleaned up, and kept out of the player
2026-08-29 17:04:23 -04:00
Georges-Antoine Assi
c3241a7236 Merge pull request #4304 from rommapp/feat/scoped-save-discovery
feat(saves): scope save discovery to a set of ROM IDs
2026-08-29 16:48:50 -04:00
Georges-Antoine Assi
bec9846718 refactor(firmware): trim comments and name the platform list
Cut the comment blocks that ran past two lines, and rename
platformItems to affectedPlatforms since it holds only the platforms
that have missing firmware, unlike the all-platforms list of the same
name in MissingGamesSection.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 16:46:51 -04:00
Georges-Antoine Assi
36bcb85921 refactor(v2): fold the last player chrome copies into the seams
Follow-up pass over the extraction:

- `usePlayerNav` gives the two back links one home. EmulatorJS's copy read
  `rom.value?.id`, so it pushed undefined params during the seed window the
  hero seeding exists to cover.
- EmulatorJS drops its hand-rolled spinner for `RSpinner` and takes
  `heroRom` for its render guard, so `heroSeed` leaves the composable's
  public surface.
- The shell owns the full-width brand row instead of letting a consumer
  reach across the seam for `grid-column`.
- Ruffle's rom ref is shallow, matching the other simple players.
- `PlayerShell.test.ts` covers the play/quit emits, the missing-platform
  guard and the loading branch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 15:58:21 -04:00
Georges-Antoine Assi
24f1d4b44e fix(platform): make firmware_count mean what rom_count means
firmware_count skipped rows flagged as missing while its sibling
rom_count counted every row, so the two fields answered the same
question differently.

Count every firmware row instead, and filter for usable BIOS in the
InfoPanel that presents the stat. The firmware list ships with the
schema, so the caller already has what it needs to decide.

rom_count keeps counting missing ROMs on purpose: the gallery and nav
gate on rom_count > 0, so excluding them would hide the platforms whose
missing ROMs still need cleaning up.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 15:57:05 -04:00
Georges-Antoine Assi
841a7a2f9f fix(settings): scope a cleanup to every selected platform
The cleanup tasks took a single platform_id while both Missing tabs
offer a multi-select, so picking two platforms ran the unscoped
cleanup over the whole library. The confirmation dialog still named
the selection, so the tab deleted more than it said it would.

Take platform_ids on both cleanup tasks and filter firmware by the
whole list, so what runs matches what the dialog names.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 15:56:56 -04:00
Georges-Antoine Assi
68168f8b5a refactor(v2): adopt the player shell in the js-dos view
The js-dos player landed on master with its own copy of the pre-game
chrome. It now takes `usePlayerHero` and `PlayerShell` and keeps only the
fullscreen switch, the browser-save note and its stage.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 15:47:51 -04:00
Georges-Antoine Assi
85be36dc0b refactor(v2): extract a shared player shell
EmulatorJS.vue and Ruffle.vue each carry their own copy of the block every v2
player opens with: the synchronous hero seeding, title, platform label and
background-art watch. Ruffle additionally hand-rolls the cover column,
settings card, back buttons and loading spinner that any simple player needs.

Extract two seams:

  * usePlayerHero — the seed/hero/title/platform-label block plus the
    background-art watch, adopted by both players. The caller keeps ownership
    of the `rom` ref because EmulatorJS needs a deep one for the save and
    state lists it mutates.

  * PlayerShell — the cover column, settings card, play and back buttons, the
    full-bleed running stage and the loading state, with `settings`, `stage`
    and `brand` slots. Ruffle keeps only its colour picker, brand strip and
    stage. EmulatorJS deliberately opts out: its hero sits inside a card with
    an alt-art glow and it lays out three panels on its own breakpoints, so it
    takes the composable alone.

Stream.vue is left alone: its label comes from the streaming container, its
background art clears while playing, and it has its own back route.

No intended behaviour change. Ruffle's hand-rolled loading spinner is now
RSpinner, matching the other players.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 15:44:48 -04:00
Georges-Antoine Assi
e36d7646b2 feat(saves): scope save discovery to a set of ROM IDs
Sync clients that hold a subset of the library had no bounded way to ask
for the saves relevant to the ROMs on the device: `GET /api/saves` filters
one ROM at a time, and negotiation always evaluated the user's whole
slotted save set, offering downloads for ROMs the device cannot play.

Add a `rom_ids` scope to both. `GET /api/saves` takes a comma-separated
list (matching the `/roms/download` convention) and `POST /api/sync/negotiate`
takes a list in the request body, so a client with many ROMs is not bound by
URL length. Negotiation widens the scope with the ROMs the client sent saves
for, so a client save is never misread as an upload because its ROM was
omitted. The scope is read-only: an omitted ROM is outside the request, never
a deletion signal.

Both share one limit and one validation rule in the saves handler, and both
reject a scope that is non-positive or over the cap rather than truncating.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 15:44:44 -04:00