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
`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
`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
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
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>
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>
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>
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>
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>
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>
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>
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.
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.
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.
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
`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.
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.
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.
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>
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>
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>
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>
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>
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>
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>