Commit Graph

267 Commits

Author SHA1 Message Date
Georges-Antoine Assi
80eca562f7 fix(demozoo): send an API key with every Demozoo request (#5723)
* fix(demozoo): send an API key with every Demozoo request

Demozoo's API has required an API key since 2026-11-01. Add
DEMOZOO_API_KEY, sent as an Authorization: Api-Key header, and enable
Demozoo when it is set, like the other key-based providers. It replaces
DEMOZOO_API_ENABLED, since requests without a key are refused.

Fixes #5698

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* pr-ready: code-review

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* pr-ready: prose

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:21:00 -05:00
Marcello Pichini
38543d9bde fix(streaming): offer disc sheets, not their tracks, as stream discs (#5710)
* fix(streaming): offer disc sheets, not their tracks, as stream discs

The start-disc picker and disc-swap dialog only treated .cue as a disc
sheet, so .gdi, .ccd and .mds sets listed their raw tracks, which the
backend rejects. Pick discs the way utils/m3u.disc_files does.

Fixes #5709

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(streaming): keep patches and variants out of the disc lists

The start-disc list now drops patch files by extension, as disc_files
does, and the swap dialog lists only the base game's discs, as
playlist_files does, so neither offers a file the backend rejects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* pr-ready: code-review

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* pr-ready: simplify

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* pr-ready: review-polish

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* pr-ready: prose

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(streaming): order stream discs by disc number

The backend's disc_files sorts by the disc tag, so a set of ten or more
discs listed Disc 10 before Disc 2 in the start and swap pickers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(streaming): offer no disc pick before the first heartbeat

Patches are recognised by the heartbeat's supported extensions, which are
empty until a heartbeat lands, so a root-level patch showed up as a disc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(streaming): decide the disc swap from the disc sent with the claim

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
2026-11-21 16:37:29 -05:00
Marcello Pichini
f448a6bbad fix(jukebox): fall back to the file name when a track's embedded title is empty (#5701)
* fix(jukebox): fall back to the file name when a track's embedded title is empty

panelTracksFromRom used ?? for the title, so an empty tag stayed an empty
title, while the catalog path (panelTracksFromCatalog) already falls back
to the file name with ||.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* test(jukebox): type the empty-title fixture instead of casting it

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-21 10:06:12 -05:00
Georges-Antoine Assi
2469839b66 fix(jsdos): play a .jsdos bundle that sits inside a game folder (#5672)
* fix(jsdos): play a .jsdos bundle that sits inside a game folder

The play check read the ROM's own extension, which is empty for a folder,
so a bundle moved into a folder (for example beside its manual) lost its
Play button. The backend now exposes has_jsdos_bundle, true when the ROM
is a bundle or has one at its folder's top level, and the js-dos player
asks the content endpoint for that file instead of a zip of the folder.

Fixes #5615

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(jsdos): assert the player downloads only the bundle file

Addresses Greptile's review on #5672: covers the bundle file id in the player URL and drops a comment that restated the constant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* pr-ready: code-review

Pin has_jsdos_bundle's value for a plain single file and for a bundle
missing from disk, on both the SQL and the with_files path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011waFLKWoBw9KCu31UJJ7Te

* pr-ready: code-review

Expose missing_from_fs on RomFileSchema so the js-dos player skips a
bundle gone from disk, the same rule has_jsdos_bundle applies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011waFLKWoBw9KCu31UJJ7Te

* pr-ready: simplify

Share the top-level file predicate and the present-file exists subquery
between is_easyrpg_game and has_jsdos_bundle, compute the top-level files
once in apply_file_stats, and fold the two marker flag tests into one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011waFLKWoBw9KCu31UJJ7Te

* pr-ready: review-polish

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011waFLKWoBw9KCu31UJJ7Te

* pr-ready: prose

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011waFLKWoBw9KCu31UJJ7Te

* refactor(jsdos): rename isJsDosBundle to hasJsDosBundle

It also matches a folder that holds a bundle, so the name now says what
the backend flag it reads says.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011waFLKWoBw9KCu31UJJ7Te

* fix(scan): derive a scanned rom's file flags from the files it read

A scan emits scan:scanning_rom before it writes the rom's file rows, so a
new rom reached clients with every file flag false (has_simple_single_file,
has_multiple_files, has_jsdos_bundle and the rest) until a reload. The
emits now derive those flags from the files the scan just read whenever it
rebuilt them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011waFLKWoBw9KCu31UJJ7Te

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 19:28:36 -05:00
Matt Van Horn
201915af07 fix(frontend): serve the generic platform icon as SVG (#5613)
The generic platform artwork is added as an SVG gamepad, and
DEFAULT_PLATFORM_ICON now points at /assets/platforms/default.svg. Load
chains that ended on the ICO now end on that SVG, including a platform
with no shipped icon. The component tests expect the SVG URL, and a new
case checks that the constant and shippedPlatformIconUrl("default") both
resolve to it.

Fixes #5599

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-11-17 07:44:01 -05:00
Georges-Antoine Assi
e813e4d666 chore(coherence): adopt Coherence with specs, invariants and a PR report (#5584)
* chore(coherence): adopt Coherence with specs, invariants and a PR report

Install @posthog/coherence as a frontend dev dependency and wire its
Claude Code hooks into the committed .claude/settings.json, so every
agent session in the repo gets the vocabulary, specs, journal and checks.
The hooks call the binary under frontend/ through $CLAUDE_PROJECT_DIR.

Declare 23 components and the entrances that carry outside trust, and
six invariants, each refuted with a deliberate break before it counted:

- every /api route requires auth and its scopes, except a named public
  list (new route sweep in tests/endpoints/test_route_guards.py)
- a hidden rom, platform or firmware answers every id route exactly as
  a missing id would (new sweep over every method of every id route)
- the unscoped save, state and screenshot fetches by id are reached only
  from their own routers (chokepoints)
- validate_path never resolves outside its base folder

The PR workflow runs in comment mode: one report comment, failing only
when Coherence itself breaks. Trunk skips Prettier and markdownlint on
*.spec.md and *.practice.md, since Prettier escapes their globs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(routes): satisfy mypy in the route guard sweep

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(coherence): record the worktree test database enactment

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(roms): answer a hidden rom like a missing one on file routes; tighten route sweeps

Addresses Greptile's review on #5584.

The rom file delete and reading-progress routes answered "File not found"
for a hidden rom but "Rom with id N not found" for a missing one, so a
caller could tell them apart. They now raise the same not-found.

The route sweeps now reach the checks they claim to test: a protected
route with no scopes counts as public (its guard admits anyone), write
requests carry a body and upload name so validation can't answer first,
RomFile-keyed routes get a real file id, error bodies are compared with
the id normalized, and the rom routes are swept with the rom hidden
directly, through its platform, and by the unrated filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(coherence): tighten route guard sweeps and isolate oracle test databases (code-review)

- Count a route as protected only when its endpoint is the scope-checking
  wrapper with non-empty scopes, not just when it declares the bearer scopes.
- Treat 401 and 403 like 422 as never reaching the visibility check, and
  sweep /api/streaming/states/{rom_id}.
- Run pytest oracles with a per-run ROMM_TEST_DB_TAG unless one is set.
- Use the shared setup-frontend action and ubuntu-24.04 in the workflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(tests): simplify route guard sweeps and path tests (simplify)

- Mark scope-guard wrappers with required_scopes so the auth sweep reads a
  public attribute instead of the private closure.
- Derive the entity regex from one segment list, ask each missing id once,
  and run the three hide scenarios through one sweep helper.
- Fold the new validate_path inputs into the existing valid, traversal and
  absolute path tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(coherence): trim workflow comments (review-polish)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(filesystem): restore the validate_path property test the paths invariant cites

Filesystem.spec.md names test_validate_path_never_escapes_its_base as the
invariant's evidence, and Coherence selects it by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(coherence): run hooks from the local binary instead of npx

Each hook calls frontend/node_modules/.bin/coherence directly and exits 0
when it isn't installed, so sessions without frontend deps (fresh
worktrees, backend-only setups, cloud setup still installing) don't report
a hook error on every tool call, and no hook pays npx's startup.

Also commits the journal and run records left by earlier sessions, which
.coherence/.gitignore keeps as durable records.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(tests): share the bearer, user token and hide helpers

Tests built the same Authorization headers and HiddenEntity rows in about
40 local copies, and two modules imported private helpers from other test
files. They now use bearer, user_headers and hide from tests/auth_helpers.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(endpoints): one 404 for a missing or hidden rom, platform or firmware

Each route wrote the missing-row 404 and the hidden-row 404 separately and
had to keep them identical by hand. visible_rom_or_404,
visible_platform_or_404 and visible_firmware_or_404 take the lookup result
and raise one answer for both, either the standard not-found or a bespoke
detail. Re-reads after a write keep a plain not-found check, so an edit that
hides the row doesn't turn into a 404 after it succeeded.

The RomFile-keyed routes (/roms/{file_id}/files, .../files/content/{name},
/roms/{file_id}/patch) name their path parameter file_id instead of id, so
the route sweep reads which id a route takes from its path and drops its
hand-kept list. URLs are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(setup): develop inside WSL on Windows

@posthog/coherence installs only on Linux and macOS, so npm install in
frontend/ fails on native Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(coherence): record the whole-repo chokepoint run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(types): regenerate API types for the file_id patch route

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 10:53:46 -05:00
Terri
8a1e6280b1 feat(saves): add save channels and snapshots (#5198)
* feat(saves): add save channels and snapshots

* feat(saves): close spec gaps in save channels and hash with sigil

* feat(saves): play snapshots in the v2 player, which pushes snapshots

* fix(saves): code review: authorization, retention losses, held-save sync, batched responses

* refactor(saves): simplify pass

* refactor(saves): review-polish pass

* docs(saves): humanizer pass

* feat(saves): run every EmulatorJS page on the v2 player

* feat(saves): per-user snapshot pins

* feat(sigil): store the identity a save restore needs and pin sigil 0f05f25

* fix(saves): meet type-aware lint in the v2 player

* feat(sigil): store N64 header and playlist title ids, pin sigil 0847fda

* feat(saves): convert saves for a core on download and list save layouts

* feat(saves): prune unreachable archival snapshots and empty detached channels on delete

* feat(saves): device sync from the token, held snapshots and shared-card pushes

* feat(saves): arc restores past abandoned snapshots and color channels by age

* fix(saves): code-review and security-audit fixes

* refactor(saves): simplify pass

* chore(saves): review-polish pass

* docs(saves): humanizer pass

* fix(sync): file RetroArch autosave versions as their channel's next snapshot

* fix(saves): address review findings and trim docstrings

* fix(saves): share-lock planned rows by id so PostgreSQL accepts the lock

* test(saves): stub the detached-channels fetch in SaveDataTab stories

* feat(saves): carry the full current snapshot in a 409, pin sigil 2071dff

* chore(sigil): pin 5d4ddb4, which reads .cue and .gdi sheets

* docs(saves): drop v2 wording now that one UI remains

* chore(sigil): pin 0190443, which reads PS2 raw BIN images and cue sheets

* fix(sigil): treat a file too short for its format as routine during scans

* chore(migrations): renumber save channel migrations after upstream's 0154

* fix(snapshots): a hardcore switch on unchanged content makes a new current

* fix(sync): decide a channel's slot from its history and the device's snapshot

* chore(docker): pin sigil at 794d99f for PSP Store release save prefixes

* refactor(db): squash the save channel migrations into 0161

Fold the slot linking (0162) and the rom_files sigil identity columns (0163)
into 0161_save_channels, so the feature ships as one revision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(saves): close visibility and input gaps found in review (pr-ready step 2)

code-review --fix:
- negotiate_sync drops channel slots on ROMs hidden from the caller
- channel PATCH/attach/DELETE answer 404 when the channel's ROM is hidden
- a push copying a save from a hidden ROM answers 404
- _own_device applies require_token_device to bound client tokens
- adopting a legacy save syncs its sharing with the channel it joins

security-audit follow-ups:
- another user's detached public save or state is no longer downloadable
- profile and option values must be a single path segment
- companions are de-duplicated and capped at 8

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(saves): share channel and asset lookups, drop duplicates (pr-ready step 3)

simplify:
- readable_channel_or_404 and channels_on_files replace four copies of the
  channel 404 check and two copies of the file-fed channel listing
- readable_rom_asset_or_404 serves both public save and state downloads
- _own_device resolves through require_device; _clone_origin takes the source
- reuse _unprocessable, DESCRIPTOR_EXTENSIONS, SAVE_SLOT_MAX_LENGTH, uniqueBy
  and uuidv7; neutral forms default their required pattern to the allowed one
- RetroArch delete checks held rows in one query, a guarded upload lists the
  slot only without a channel head, and uploads are read off the event loop
- snapshotSession builds push requests once; player comment cleanups

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(saves): trim two docstrings to two lines (pr-ready step 4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(saves): answer held RetroArch paths with 423, mirror slot labels

- RetroArch Cloud Sync answers 423 Locked for a PUT over a held unslotted save
  and for a DELETE where only held rows sit at the path, instead of 409 and 404
- channelLabelForSlot returns null for blank and state_ slots, as the backend's
  channel_label does, so the player files them under no channel either
- document that sharing a channel lets every user read and push into it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(docker): pin sigil at 85f88a8 for Switch .nup containers

* fix(snapshots): a save pushed in another shape or format makes a new current

* refactor(saves): drop the always-true SAVE_SYNC.SNAPSHOTS heartbeat flag

Nothing reads it, and the SAVE_SYNC block's presence already tells a
client the server speaks the snapshot API. Also trim the rom detail
channel field comments to one line each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(frontend): use uuidv7 for every client-generated id

Drop the randomToken wrapper and the notification inbox's Math.random tab
id, so uuidv7 is the one helper that works outside a secure context.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(saves): trim redundant snapshot API surface, dead code and duplicate logic

API:
- Drop PUT /snapshots/{id}/devices/{device_id}; GET /snapshots/{id}?hold=true holds.
- GET /snapshots is history only (channel_id required); GET /channels serves currents.
- A snapshot carries channel_id instead of an embedded channel.
- POST /saves/{id}/content takes the same query parameters as the GET, plus container_path.

Backend:
- Remove the archival write path, clone.py, DBStatesHandler.get_state, the sigil
  identity-hash path, unused relationships and composite snapshot indexes.
- One held/frozen lookup, one bulk-delete guard, SQLAlchemy dialect upserts, and
  the shared reserve_version_name in the writer.
- The writer takes a visibility filter and checks the channel and parent itself.
- The restore handler picks per-game or merge; fewer wrapper types and tables.

Frontend:
- Channel delete uses the shared typed confirm; DeleteChannelDialog is gone.
- Held offline pushes go through a per-channel SnapshotSession.
- Remove the slot-based pending upload path.
- The timeline shares the fan's badge logic.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* refactor(saves): release archival backups through module functions

The saves and states handlers each built a private DBSnapshotsHandler to
call release_backup and refresh_backup_digests, since they can't import
the shared instance. Both only ever ran inside the caller's session, so
they are now module functions taking it, like channel_for_slot.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* refactor(saves): share one deleted-assets handler instance

The saves handler built its own DBDeletedAssetsHandler because it can't
import the package's instance. The instance is now built in
deleted_assets_handler.py and re-exported by the package, so both use it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 21:59:19 -05:00
Sam Dornan
4730ad61d6 perf(frontend): drop lodash for small native helpers (#5561) 2026-11-11 09:20:57 -06:00
Stu Anderson
1bb3ee7c51 perf(frontend): poll the gamepad only while one is connected (#5547)
* perf(frontend): poll the gamepad only while one is connected

useGamepad and useRightStickScroll ran requestAnimationFrame loops on every
page, with or without a pad. They now start on gamepadconnected and pause
when the last pad leaves.

Written primarily by Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(frontend): reset held pad state before polling pauses

When the last pad disconnected mid-hold, polling paused with the exit
chord's timer still running, so a reconnect could fire it early. One last
tick with no pad resets it through the loop's own path.

Written primarily by Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(frontend): apply code-review fixes to pad-gated polling

Guard hasUsablePad against a blocked gamepad API, drop the now-dead
in-loop pad detection, and cover pausing on the last disconnect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(frontend): apply simplify pass to pad-gated polling

Move usePadRafFn into its own composable as a pure connect/disconnect
gate, and let useGamepad release its exit chord in its own disconnect
listener instead of the helper running a final frame for every caller.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(frontend): probe for a pad once a second while polling is idle

Some webviews expose a pad through getGamepads() without firing
gamepadconnected, which would leave the controller dead until a reload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
2026-11-11 08:33:37 -05:00
Georges-Antoine Assi
03636ec156 fix(player): boot the base game, not a patch or translation (#5538)
* fix(player): boot the base game, not a patch or translation

Files in a game's translations/ or hacks/ folder were mixed in with the
base game: a .ups or .bps there counted as a bootable translation, a
tagged variant sorting first became the default, and "All discs" zipped
every file so EmulatorJS booted a translation's playlist.

Patch files are now recognised by extension wherever they sit, the
default and the selector's order favour the top-level (base) files, and
"All discs" requests only the base set through file_ids. The content
endpoint generates its playlist when the served files carry none, rather
than when the rom has one anywhere.

Fixes #5462

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(player): apply code-review fixes

Share the m3u check through has_playlist, memoise the boot file ids, and
correct the playerDisc comments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(player): simplify the base-set helpers

One allDiscFiles helper backs offersAllDiscs, defaultDisc and bootFileIds,
and isPatchFile alone owns the patch rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(player): keep variants and media out of playlists; classify patches on the backend

The backend's disc rule now leaves out patches, media and cheats, and a
playlist covers only the base game's discs, so whole-rom downloads, the
native shell and the streaming disc swap stop listing translations, hacks
or a selected manual. A selection with no disc gets no generated .m3u.

The scanner files any patch format as a patch, and the file schema does
the same for rows scanned before, so the frontend trusts the category.
The heartbeat now carries the supported patch extensions, which replaces
the frontend copy, and one fileExtension helper replaces three.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 21:56:17 -05:00
Georges-Antoine Assi
0a643a3e8e fix(sync): resolve RetroArch save names to the core's platform (#5533)
* fix(sync): resolve RetroArch save names to the core's platform

A RetroArch Cloud Sync path names a game by file name only, so a name
shared across platforms (a PS1 and a Saturn "Road Rash (USA)") always
resolved to the lowest-id ROM. Uploads landed on the wrong ROM and the
manifest hid the other platform's saves.

Map each RetroArch core folder to the platforms it runs and prefer a ROM
on one of them, including one that only owns a file of that name. An
unknown core, or none, keeps the previous id order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(sync): build the RetroArch arcade core platforms from the arcade sets

Addresses Greptile review on #5533: MAME and FBNeo left out the mame,
mame-advmame, fbneo and fba platforms, so a same-named Neo Geo ROM could
take over a MAME ROM's saves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(sync): apply code-review fixes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(sync): apply simplify cleanups

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(sync): cover a manifest with one name under two cores (review-polish)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(sync): one core map, per-disc state slots, PSP serials on PSP

- Move the EmulatorJS platform-to-cores map to the backend and serve it on
  the heartbeat; RetroArch core platforms invert it plus a top-up for
  RetroArch-only cores.
- Map fbneo to "FinalBurn Neo" and dosbox_pure to "DOSBox-pure", the
  library names the cores report to RetroArch.
- Resolve states by file name like saves, with a slot per disc-named state,
  so a disc folder game's state follows its save.
- Resolve PSP serial-map titles with PPSSPP's platforms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:57:39 -05:00
Georges-Antoine Assi
b0de3f224c fix(search): reword the physical filter's file option (#5529)
"Show ROMs with a file only" read as "file-only ROMs", as if games that
are also owned physically were excluded. A physical game in RomM is a
file-less row, so the option already shows every ROM with a file;
"Show only ROMs with a file" says that. Other locales already phrase it
this way.

Fixes #5481

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:09:59 -05:00
Nathan Alcantara
e8fa1d5f20 chore(scan): recognize Brazilian Portuguese as a language (#5499)
* feat(scan): recognize Brazilian Portuguese as a language

Add "Pt-BR" (Brazilian Portuguese) to the filename language table, so
"(Pt-BR)" and "(T-Pt-BR)" no longer fall back to an unrecognized tag or
to European Portuguese, and show the Brazilian flag for it in the UI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(scan): read the regional variant ahead of a translation's version

"[T+Pt-BR1.1_Grp]" kept the version in the lookup and fell back to
Portuguese. Match only the two-letter variant that opens the patch, and
cover the Brazilian flag in the frontend tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* style(scan): apply black formatting

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 07:42:56 -05:00
renovate[bot]
3224220a1f chore(deps): update dependency rq to v3 (#5493)
* chore(deps): update dependency rq to v3

* fix: adapt the RQ worker and job types to rq 3

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix: update worker tests and task status map for rq 3

The worker tests pass the Execution to perform_job and patch the
module-level execute_failure_callback. TaskStatusItem covers the new
rate_limited and ready_to_enqueue statuses, shown as queued.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Sam Dornan <sam.dornan@athleticgreens.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
2026-11-05 10:39:35 -05:00
Georges-Antoine Assi
cf47d4572f fix(player): point RetroArch's system directory at PUAE Kickstarts (#5444)
* fix(player): point RetroArch's system directory at PUAE Kickstarts

EmulatorJS's retroarch.cfg has no system_directory, so RetroArch falls
back to the content directory. WHDLoad games packed in a subfolder then
miss the Kickstarts RomM writes to the system directory, and PUAE boots
AROS instead.

When EJS_externalFiles targets the system directory (only PUAE today),
append system_directory to retroarch.cfg as soon as gameManager is
assigned, before the core boots. Other cores keep the content directory
fallback, since EJS_biosUrl and keepArcadeBiosWhole put their BIOS there.

Fixes #5247

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(player): reword the system directory comment per Greptile review

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 08:16:29 -05:00
Georges-Antoine Assi
2a3cefb9e8 fix(player): keep the CD-i BIOS archive whole for same_cdi (#5440)
EmulatorJS 4.2.3 unpacks the BIOS archive and writes its members loose at
the content root, so same_cdi (MAME-based) never finds cdimono1.zip or a
cdimono1/ folder on its rompath and reports cdi200.rom as missing. Route
the same_cdi core through keepArcadeBiosWhole so cdimono1.zip lands whole
at the root, which is the first rompath entry the core searches.

Fixes #5215

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 19:28:21 -05:00
Sam Dornan
4393b70973 feat(media): JPEG XL library images and cover uploads (#5438)
* feat(media): serve JPEG XL library images inline

Add .jxl to the image extensions the download endpoint serves inline,
with an explicit image/jxl type since mimetypes doesn't know it, and to
the frontend lists that pick artwork and folder screenshots out of
rom.files. AVIF was already covered; the new test pins both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NH5s4hx1GtQiHd7vsLCpBs

* feat(media): accept JPEG XL cover uploads through a Pillow plugin

Pillow 13 reads AVIF but not JPEG XL. pillow-jxl-plugin registers a
JXL codec with Pillow (imported once in utils/images, which the cover
and WebP-conversion code already load). It ships musllinux wheels for
the image's amd64 and arm64 builds.

ROM and collection artwork uploads now accept image/jxl and store it
re-encoded as PNG, since covers are served in their stored format and
not every browser renders JPEG XL. Avatars, stored as uploaded, keep
the PNG/JPEG/WebP/GIF allowlist.

The plugin is GPL-3.0, which is compatible with RomM's AGPL-3.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NH5s4hx1GtQiHd7vsLCpBs

* test(roms): expect JPEG XL in the artwork rejection message

Artwork uploads now also accept JPEG XL, so the rejection message lists
it. The collection tests were updated with the change; this ROM one was
missed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NH5s4hx1GtQiHd7vsLCpBs

* fix(media): list library JPEG XL images only where the browser renders them

Library files are served as stored, and Chrome and Firefox render no
JPEG XL, so .jxl artwork and folder screenshots showed as broken tiles
there. A one-time probe decodes a 22-byte JPEG XL image and the artwork
and screenshot lists only include .jxl files once it succeeds (Safari),
updating reactively when the answer arrives. Chromium 153 fails the
probe, so the files stay hidden there as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NH5s4hx1GtQiHd7vsLCpBs

* fix(media): size-check JPEG XL before decoding and keep it out of screenshot uploads

pillow-jxl decodes every pixel in _open(), before Pillow's
decompression-bomb check sees the size, so a small, highly compressed
JXL declaring a huge canvas could exhaust memory. utils/jxl reads the
width and height from the codestream SizeHeader (bare or inside a
container) and runs Pillow's own bomb check on them first, then
registers this guarded decoder in place of the plugin's.

The decoder raises RuntimeError on a corrupt file, which escaped
store_artwork as a 500. The guard turns it into SyntaxError, so Pillow
reports UnidentifiedImageError and the upload takes the same path as a
corrupt PNG.

POST /api/screenshots validated against the library inline list, so it
started accepting .jxl, but the asset endpoint serves those as
attachments. Screenshot uploads now use their own list without JPEG XL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NH5s4hx1GtQiHd7vsLCpBs

* style(media): one-sentence jxl docstring and a narrowed mock call in the JXL test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NH5s4hx1GtQiHd7vsLCpBs

* style(media): one-sentence canRenderJxl doc comment

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NH5s4hx1GtQiHd7vsLCpBs

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 16:14:06 -06:00
Sam Dornan
63d9a39656 feat(platforms): facet filters and a group-by menu on the platforms index (#5434) 2026-11-01 09:28:17 -06:00
Georges-Antoine Assi
f6002a76a3 fix(switch): explain why encrypted dumps get no title id (#5428)
* fix(switch): explain why encrypted dumps get no title id

RomM doesn't read prod.keys, so encrypted retail NSP/XCI dumps resolve no
title id, and nothing said so. A scan now logs one info line counting the
encrypted Switch files it skipped, a Switch game without a title id says
why on its metadata tab, and key files in the Firmware tab are marked as
not used by RomM.

Fixes #5330

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(switch): keep each scan's encrypted file count separate

Addresses Greptile's review on #5428: scans overlapping in one process
(DEV_MODE) shared the module-level set, so a second scan's begin_scan
cleared the first's count. The set now lives in a context var that each
scan's rom tasks inherit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 10:22:23 -05:00
Sam Dornan
c5c6ef3119 fix(ra): count earned achievements that share a badge separately (#5423)
* fix(ra): count earned achievements that share a badge separately

Earned achievements were stored and matched by badge name, which several
achievements in one set can share. Those collapsed into one entry, so the
game header undercounted (71/75 on a mastered set) and earning one of them
marked them all as earned.

Each earned entry now also carries the achievement's own ra_id, and the
game details view matches on it. Progressions stored before this are read
again on the next sync, and until then entries without an ra_id still
match by badge.

Fixes #5385

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NH5s4iit2hMN1bb49UMpcT

* test(ra): give the legacy-entry loop its own variable for mypy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NH5s4iit2hMN1bb49UMpcT

* feat(ra): mark the badge-name id of earned achievements deprecated

Several achievements can share a badge, so ra_id is the field to match
on. The OpenAPI schema now flags id as deprecated and points to ra_id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NH5s4iit2hMN1bb49UMpcT

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 17:04:38 -05:00
berce
212caf1a28 feat: expose the parsed ROM version in the API and game overview (#5255)
* feat(api): include the parsed version tag in ROM responses

The filename parser stores a version tag such as `(v2.00)` or
`(version CN-07)` in `Rom.version` and keeps it out of `tags`, but the ROM
response schemas never exposed it, so a client had no way to read it.
Add `version` next to `revision` and regenerate the frontend types.

Closes #5243

* fix(frontend): give hand-built ROM objects the new version field

romFixture(), the list row fixture and RelatedGameCard build SimpleRom
objects by hand, so vue-tsc rejected them once version became a required
schema field.

* test(roms): fix mock parameter order in version tag test (code-review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(api): return null for a missing revision or version and clear version on unmatch

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(frontend): show the parsed ROM version on the game overview

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 09:46:04 -04:00
Sam Dornan
dbc14db491 fix(frontend): give white text on the brand fill AA contrast in dark mode (#5402) 2026-10-29 18:12:53 -05:00
Sam Dornan
7e04cf864f fix(frontend): let pad A toggle checkboxes, open read-only fields and keep focus after a pick (#5401) 2026-10-29 17:49:34 -05:00
Georges-Antoine Assi
190a219c8c refactor(player): build the EmulatorJS globals in one pure function (#5397)
* refactor(player): build the EmulatorJS globals in one pure function

EmulatorJSPlayer.vue configured EmulatorJS through about 90 lines of
`window.EJS_*` assignments mixed into its setup, reading props, the
config store, i18n and the DOM along the way, and declared the 60-line
global type block it relied on. None of it could be tested without
mounting the player.

buildEjsConfig() in views/Player/emulatorJSConfig.ts now takes those
inputs and returns every value, and applyEjsGlobals() writes them onto
window in one place. The Window declarations move with them. The
component builds the input from its props and stores and keeps
everything else (save sync, the default-options trap, the netplay audio
tap, the reload on unmount) as it was.

The values are unchanged, including two existing quirks kept on purpose:
the controls are still looked up by the requested core and the core
options by the resolved one, and the controls and cache limit are only
set when configured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(player): build firmware fixtures from a typed factory

Addresses Greptile's review: firmwareFixture returns a complete
FirmwareSchema instead of a cast partial, used by the EmulatorJS config
and launch intent tests, and two config comments are trimmed to the
comment rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 17:25:16 -04:00
Sam Dornan
10f3968fb9 fix(frontend): pad A picks the active option in an open select (#5389)
* fix(frontend): pad A picks the active option in an open select

An open RSelect keeps focus on its activator (or its search field) and
points at the active row with aria-activedescendant. Pad A clicked the
focused element, so it closed a plain select without picking, and did
nothing in a searchable one. A now clicks an expanded combobox's active
option.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NH5s4hejU8pB4AEAxTT2f9

* Apply suggestion from @greptile-apps[bot]

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-10-29 14:46:24 -05:00
Sam Dornan
ee29b1e2a4 refactor(frontend): rename RImg to RImage (#5387)
Spells the primitive out like every other one in src/lib (RIcon,
RTextField, RSegmentedControl). Renames the component, its folder,
story, story stylesheet, and the r-img CSS classes. No behaviour change.


Claude-Session: https://claude.ai/code/session_01NH5s4h1gm17cCYTX1t7BQX

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 11:06:17 -05:00
Spinnich
60703be09c chore(platforms): split arcade aliases into per-emulator-family slugs (#5273)
* feat(platforms): split arcade aliases into per-emulator-family slugs

Give MAME, AdvanceMAME, FBNeo, FBA, Daphne, Singe and the arcade boards
that need their own emulator (NAOMI/NAOMI 2/NAOMI GD-ROM, Model 2/3,
Hikaru, Triforce, Lindbergh, Namco System 246/3xx, Gaelco, ...) their own
slugs with verified provider IDs. Providers without a dedicated entry fall
back to their Arcade platform via arcade_fallbacks(). MAME-only boards
(CPS1-3, System 16/32, Model 1, Namco 22) stay aliases of arcade.

Refs #5272

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(platforms): code-review pass on arcade slugs

- Retry IGDB on unmatched scans for every platform IGDB resolves, not
  just slugs in IGDB_PLATFORM_LIST.
- Resolve config binding/version values through the alias table, so a
  binding to a retired slug (cps2, model1, ...) still lands on a platform.
- Alias the Batocera `typex` folder to type-x.
- Build provider id->slug reverse maps before merging Arcade fallbacks.
- Share one MAME title lookup between base_handler and libretro.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(platforms): simplify pass on arcade slugs

- Alias the three RomM-keyed IGDB versions inside IGDB_PLATFORM_VERSIONS,
  dropping IGDB_VERSION_SLUGS and _version_slug.
- Derive EmulatorJS arcade entries from ARCADE_SET_PLATFORMS.
- Remove the unused provider id->slug reverse maps, so the Arcade
  fallback merge no longer has an ordering constraint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(platforms): humanizer pass on arcade slug comments

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(platforms): settle arcade slug review decisions

- Migration 0154 moves platforms still on a retired MAME-only board slug
  (cps1-3, model1, system16, system32, system-32) to arcade, so no row
  carries a slug the enum no longer has.
- MAME shortname expansion keys off the RomM slug via
  MAME_SHORTNAME_PLATFORMS instead of per-provider arcade ids, so Daphne,
  Singe, Type X and Lindbergh sets are no longer read as MAME sets. Neo Geo
  now expands at ScreenScraper too, as it already did at IGDB and Moby.
- fba offers fbneo before the FinalBurn Alpha CPS cores.
- AdvanceMAME leaves the WebRcade feed; EmulatorJS and WebRcade share
  PLAYABLE_ARCADE_SET_PLATFORMS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(platforms): code-review pass (xhigh) on arcade slugs

Verify arcade-board BIOS files against the known list's arcade entries,
and make migration 0154 match retired slugs case-insensitively.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(platforms): simplify pass on arcade slugs

Apply IGDB family overrides once in get_platform instead of on each
return path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(platforms): use a slug with no shipped icon

singe now ships an icon, so the no-icon prefetch test needs a slug that never will.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(platforms): add a teknoparrot arcade slug

TeknoParrot runs PC-based arcade boards outside the MAME/FinalBurn family,
so its folder gets its own platform (RetroBat and ES-DE both use
`teknoparrot`). Providers fall back to their Arcade entry, MAME shortname
expansion skips it, and it gets a placeholder icon copied from `arcade`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(platforms): give each arcade-family icon its own marquee title

Redraws the ARCADE marquee on the copied cabinet icons with each
platform's name, in the Bungee typeface with the original inline and
extrusion styling. Sega boards use Sega blue, Namco systems Namco red,
and Type X Taito blue; the rest keep the original amber.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(platforms): code-review pass (xhigh) on arcade slugs

Neo Geo BIOS lives under arcade in the known BIOS list, so map
neogeoaes and neogeomvs there too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(platforms): simplify pass on arcade slug tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
2026-10-28 19:53:06 -04:00
Ellis Nieuwpoort
7941d352eb fix(v2): stop game videos from holding connections they no longer need (#5236)
* fix(v2): stop game videos from holding connections they no longer need

* fix(v2): keep hover previews from stopping a playing clip (pr-ready: code-review)

Hover previews get their own release slot so a cover hover no longer
stops a trailer the user started, the play() promise no longer marks a
released preview as playing, and MiniPlayer reuses releaseMedia.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(v2): share the cover release path, dedupe a test stub (pr-ready: simplify)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(v2): skip the hover clip release when it never played

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 11:00:22 -04:00
Georges-Antoine Assi
3a79911b2f Revert "feat: classify ROMs by release type (homebrew, hack, translation, ...) (#5363)" (#5365)
This reverts commit 08acaa9ea.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 08:21:22 -04:00
Sam Dornan
08acaa9ea9 feat: classify ROMs by release type (homebrew, hack, translation, ...) (#5363) 2026-10-26 21:34:35 -05:00
Georges-Antoine Assi
ff9627ae70 fix(auth): require the current password to change your own username, password or email (#5351)
* feat(auth): require the current password to change your own password

PUT /api/users/{id} set a new password or email for the caller with
nothing more than a me.write credential, so a leaked client token or a
hijacked session could take the account over for good.

A self-edit that changes the password or the email now needs
current_password, checked with bcrypt off the event loop (400 when
missing, 403 when wrong). Admins editing another user and the
forgot/reset-password flow are unchanged. Accounts with no local
password (OIDC-provisioned placeholders) can set a first one only from a
sign-in session, not from a bearer or client token.

UserSchema gains has_password so the UI asks for the current password
only when the backend will: the change-password dialog, the profile
email field, and the edit-user dialog when editing yourself.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* docs(user): shorten _verify_account_holder docstring

Addresses Greptile review on #5351.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(user): treat a case-only email edit as no change (code-review)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(user): simplify current-password checks and tests (simplify)

Hash the new password off the event loop, reuse errorMessage and the
viewer token fixture, and table-drive the needsCurrentPassword tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(user): require the current password to change your own username

Login is by username and a rename revokes every session, so a stolen
me.write token could lock the owner out without touching the password.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(user): lock the email of OIDC accounts to the identity provider

The provider overwrites a linked account's email at every sign-in, and
finds an unlinked password-less account by it, so a self-edit is either
lost or breaks SSO sign-in. Admins can still change it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(RTextField): give read-only fields a muted style

Dashed chrome, no fill and muted text, with no hover or pointer-focus
halo, so a locked value no longer looks editable. Keyboard and gamepad
focus keep their outline.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-26 11:12:27 -04:00
Sam Dornan
70f125d184 chore(frontend): remove Tailwind CSS and Vuetify (#5315) 2026-10-25 05:03:45 -05:00
Sam Dornan
7eae2b8ffb chore(frontend): remove the v1 UI and console mode (#5309) 2026-10-23 19:37:45 -05:00
Sam Dornan
b576d9e8b6 chore(eslint): adopt @vue/eslint-config-typescript and lint with type information (#5148) 2026-10-05 15:10:12 -04:00
Sam Dornan
7b1028bedd feat: search platforms by slug, abbreviation and alternative names (#5107) 2026-10-04 22:59:52 -04:00
Sam Dornan
c1c3058499 fix(metadata): four provider fixes; test Hasheous, TGDB, CSDb, gamelist and libretro (#5128) 2026-10-04 15:39:48 -04:00
Sam Dornan
11c82aa522 test: typed ROM fixtures, and no ROM casts in tests or stories (#5122) 2026-10-04 14:01:17 -04:00
Sam Dornan
c402da2599 test: platform fixture factories for the backend and frontend (#5119) 2026-10-04 13:11:33 -04:00
Georges-Antoine Assi
6f2a361481 Play RPG Maker 2000/2003 games in the browser with EasyRPG (#5077)
* feat(player): play RPG Maker 2000/2003 games in the browser with EasyRPG

Embed the EasyRPG web player for extracted game folders on the rpg-maker
platform. The backend generates the player's index.json from the scanned
files and merges in the free EasyRPG RTP under every name the official
and fan RTPs give its assets, so games that lean on the RTP find them.
In-game saves sync with the user's RomM saves through the player's
IndexedDB storage.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(easyrpg): read the free RTP from a fixed path instead of an env var

The full image always keeps the RTP at /var/www/html/assets/easyrpg/rtp,
so the path is a constant beside the web path nginx serves it under. The
dev container links its copy there at startup.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(easyrpg): code-review fixes for the save sync and asset endpoint

- Wait for an in-flight push before the quit push, so the newest save uploads
- Keep Play disabled until the fresh rom (and its saves) is fetched
- Stop onPlay and the rom fetch from acting after the view unmounts
- Leave through usePlayerExit like the other players
- Handle a rejected IDB commit when the run itself fails
- Track uploads by the browser's file name
- Load only visibility and files per asset request, not the full rom
- Serve DEV_MODE files as octet-stream, matching nginx
- Make the traversal test actually reach the endpoint

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(easyrpg): simplify pass over the player and asset endpoint

- Load only file paths per asset request, and look up RTP folders in O(1)
- Reuse RomFile.file_name_for_download and usePlayerFullscreen
- Share one dev/prod serve helper for game and RTP files
- Derive the save sync's game key from the rom
- Have the RTP table tool reuse normalize_name
- Make save-module internals private and tidy the prepare/read loops

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(easyrpg): flag RPG Maker game folders on the rom schemas

Gallery lists carry no files, so the frontend guessed that every multi-file
rom on the rpg-maker platform was playable, including RPG Maker XP/VX/MV
folders. Rom now has a deferred `is_easyrpg_game` subquery (an RPG_RT.ldb at
the folder root), loaded with the other gallery file stats and derived from
loaded files on the with_files path, and the frontend reads it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(easyrpg): drop server save sync, keep saves per user in the browser

Server sync moves to a follow-up that puts the web players on device sync.
Saves now stay in the player's IndexedDB, as js-dos does, with the same note
on the start page. The player is launched as `<rom id>-<user id>` so each
RomM account sharing a browser profile keeps its own saves; nginx and Vite
drop the user id when routing to the backend.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(easyrpg): address Greptile review

- Start timing the play session once the player page loads
- Use object-form props in the view test's button mock
- Keep the RTP table tool's docstring to one sentence

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(easyrpg): keep the RTP table in a fixtures folder

Matches handler/metadata/fixtures, where the other bundled data files live.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-03 17:51:38 -04:00
Sam Dornan
c420f92085 fix(v2): draw under the iOS status bar and respect safe-area insets (#5075) 2026-10-03 12:22:21 -04:00
Sam Dornan
fbfa12cf07 Prepare v2 and shared code for exactOptionalPropertyTypes (#5065) 2026-10-03 00:38:46 -04:00
Sam Dornan
e7a9815780 Prepare the shared frontend code for noUncheckedIndexedAccess (#5062) 2026-10-02 22:18:43 -04:00
Sam Dornan
4a53fcd172 Use VueUse for v2's rAF loops, listener pairs and grid observers (#5045)
* Use VueUse for v2's rAF loops, listener pairs and grid observers

Hand-managed requestAnimationFrame loops in useGamepad, usePlaybackTime,
useRightStickScroll, ControllerDebug and RBox3D move to useRafFn, and
the listener pairs and MutationObservers in useGridNav, useWrapGridNav,
RBox3D and useGamepad's connect listener move to useEventListener and
useMutationObserver. Each stops with its scope, so the matching cancel,
remove and disconnect calls in unmount hooks go. The grid composables
still register from onMounted, keeping listener order unchanged.

ControllerDebug pauses its loop before leaving on hold-B. RBox3D's root
listeners now bind once its template ref settles, a microtask after
mount, instead of synchronously in onMounted.

Adds tests for usePlaybackTime, useRightStickScroll, ControllerDebug and
RBox3D, the late-cell autofocus of both grid composables, and
useGamepad's unmount. They also pass against the previous versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep ControllerDebug polling past a back that goes nowhere

Hold-to-exit paused the frame loop before calling router.back(), so in a
tab opened straight onto /controller-debug the back did nothing and the
inspector froze. The loop now keeps running and fires once per hold, and
with no history entry to return to it goes home instead.

The useGamepad, useRightStickScroll and ControllerDebug tests build pads
from a shared, fully typed gamepad fixture rather than casting partial
objects to Gamepad.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 13:38:18 -05:00
Sam Dornan
b5268e959d Copy over plain HTTP and skip task polling in hidden tabs (#5040)
* Copy over plain HTTP and skip task polling in hidden tabs

useClipboard now falls back to execCommand("copy") when the Clipboard
API is missing (any insecure origin, such as a LAN install served over
HTTP) or its write rejects. The fallback checks execCommand's result, so
a copy that fails still shows the error toast, and it hands focus back
to the trigger for spatial and grid nav. VueUse's useClipboard legacy
mode was considered and rejected because it reports success even when
execCommand fails.

TasksSection skips its 5s status poll while the tab is hidden and
fetches once when it becomes visible, matching Home and Activity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J28XLfUSEgeZ6uMDiCL6vy

* Keep only the newest task status and tidy clipboard fallback

The tasks store now applies a status response only if no newer request
started after it, so an older poll can't overwrite the result of a
visibility refetch or a run-button refresh that finished first.

The clipboard fallback focuses its textarea before selecting it, which
some engines need for execCommand("copy"), and the useClipboard and
HashChip docs now describe the fallback. Drops a comment that compared
the fallback with VueUse's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J28XLfUSEgeZ6uMDiCL6vy

* Keep an older task status when a newer request fails

The status guard now tracks successes and failures separately: a
success applies unless a newer success already has, and a failure
clears the list only when no newer request has started. An older
success that settles after a newer failure is applied instead of
dropped.

Moves the typed task status builder to utils/tasks.fixtures.ts so the
store and TasksSection tests share it instead of casting literals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J28XLfUSEgeZ6uMDiCL6vy

* Keep the last known task status when the newest request fails

Only the newest status request may write the list, and a failure no
longer clears it. Clearing showed nothing running and re-enabled run
buttons, and applying an older success after a newer failure showed a
pre-run snapshot as current. Keeping the last known statuses avoids
both, since the newest request has no state to offer when it fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J28XLfUSEgeZ6uMDiCL6vy

* Shorten the clipboard and task status comments

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J28XLfUSEgeZ6uMDiCL6vy

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 11:31:19 -05:00
Georges-Antoine Assi
819811b155 feat(converto): library format settings and "Download as" on the game page (#5000)
* feat(converto): integrate rom-converto for title id extraction and download conversion

* feat(converto): add conversion settings UI with per-platform format policies

* fix(converto): read conversion targets from the backend and translate the settings page

* fix(docker): ship rom-converto in the production image

Only the dev Dockerfile installed the binary, so the integration could
never enable on a released image. Fetch the same pinned, checksummed
musl build in a dedicated stage and copy it next to RAHasher.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(converto): skip the update check and batch info calls

The CLI asks api.github.com for a newer release on every run unless
told not to, so pass --no-update-check on each invocation. Inspect a
rom's files in one `info --paths-file` run instead of one subprocess
per file, and read the inspectable extensions from the capabilities
manifest so scans skip files info cannot recognize.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(scan): keep sigil authoritative for title ids

rom-converto ran first and overrode the ids sigil read. Sigil now runs
first and records its per-file ids; rom-converto only fills files sigil
left unset, on new or changed files, in one batch. Restore the base-id
selection for sigil extractions on every platform, as on master.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(downloads): make conversion opt-in and bound the cache

The download endpoint returned a converted file to every client once a
platform had a target, including the browser player and apps that check
hashes against RomFile. Conversion now needs ?converted=true.

A pre-warmed copy is served whatever its size; the in-request size cap
only gates starting a conversion. ROM_CONVERTO_CACHE_MAX_SIZE_GB
(default 20, 0 unbounded) caps the cache: conversions and the pre-warm
task stop when it is full, and cleanup evicts the least recently served
copies.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(types): regenerate frontend types for the converto schema

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(converto): address code-review findings (pr-ready step 2)

- Fall back to rom-converto's stored ids only when it ran this pass, in
  disc order, so a rescan that skipped extraction keeps sigil's save target
- Persist per-file title ids that extraction writes onto reused rows
- Only authenticated callers may start an in-request conversion; past a
  240s deadline serve the original and let the conversion finish into the
  cache instead of nginx returning 504
- Treat a probe OSError or timeout as a failed probe; kill the subprocess
  when the caller is cancelled
- Give the pre-warm task the scan timeout and report progress in the
  ConversionStats shape the task UI reads
- Reuse zip_cache constants, walk the cache off the event loop, tolerate
  files vanishing mid-cleanup, and trim long comments

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(converto): simplify conversion code (pr-ready step 3)

- Move the converted-download policy (target lookup, cached-first, sync
  size cap, deadline) from the endpoint into utils/conversion_cache and
  share conversion_target with the pre-warm task
- Share one path lookup between get_cached_converted and get_or_convert;
  the pre-warm walks the cache once and tracks a running byte budget
  instead of walking it twice per rom
- One normalize_platform_formats beside TARGETS_BY_PLATFORM for the
  config loader (via _validated_platform_map) and the settings endpoint;
  update_converto_settings takes a ConvertoConfig and is written back
  with dataclasses.asdict
- read_infos owns its never-raise contract, so the scan drops its blanket
  except; drop the unused RomConvertoInfo.kind and error attributes
- Sort files for the rom-converto identity only when it is used; stat
  each cached file once during cleanup

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(converto): trim comments (pr-ready step 4)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(converto): convert on first download instead of pre-warming

A library pre-warm fought the TTL: cleanup dropped every copy nobody
downloaded within a day. Remove the Convert library task and convert on
demand only. Files over ROM_CONVERTO_MAX_SYNC_SIZE_MB now start their
conversion in the background while the original is served, so the next
download within the TTL gets the converted copy at any size.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(converto): drop decrypt and encrypt download targets

Downloads now only change a rom's container or compression (CHD, RVZ,
CSO, NSZ, ...); serving decrypted files is left for a separate decision.
NDS and PS3 have no remaining targets. Also note that the conversion
concurrency limit applies per process.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(converto): move the cache limits into converto.*

cache_max_size_gb and max_sync_size_mb join cache_ttl_hours in
config.yml and PUT /api/config/converto_settings, replacing the
ROM_CONVERTO_CACHE_MAX_SIZE_GB and ROM_CONVERTO_MAX_SYNC_SIZE_MB env
vars, so every eviction knob is edited in one place at runtime. The
loader takes its defaults from ConvertoConfig and one table holds each
integer's minimum for both the loader and the payload.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(converto): lock conversions with flock instead of a sentinel

A conversion now holds a non-blocking flock on its key dir, which the
kernel releases if the worker dies. That replaces the .partial sentinel,
its 6-hour staleness guess (which a long ROM_CONVERTO_TIMEOUT could
outlive), and the rename-aside takeover. Cleanup skips locked dirs, and
partial output gets a hidden name so it never counts as a served copy.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(converto): parametrize repeated test cases

Collapse the per-platform info parsing, operation resolution and
converto_active cases into parametrized tests, so a new platform or
target is one row.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(scan): run rom-converto first with sigil as the fallback

rom-converto reads each rom's new or changed files first, in one batch,
and its title ids win. sigil still reads what it can, since it alone
provides save targets and Switch content types, and fills the ids
rom-converto left unset.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(converto): edit the cache size limits on the settings page

* feat(converto): store per-file metadata read by rom-converto during scans

* fix(converto): show the labels of the cache settings fields

* fix(scan): keep the stored save target when sigil reads nothing

* fix(converto): read Xbox 360 disc ids and Wii title versions, store content type as text

* feat(converto): save file icons, banners and backgrounds read by rom-converto

* chore(converto): bump rom-converto to v0.23.0

* fix(converto): address review findings in the conversion cache, scan metadata and settings

* refactor(converto): move per-file metadata out of the conversion PR

Scan-time metadata (title ids, the 17 rom_files columns, artwork and
converto.scan_metadata) moves to its own PR so its columns land with the
UI that reads them. This PR keeps conversion only.

The conversion cache no longer has uncompressed_size_bytes to budget
with, so a conversion to an uncompressed target reserves a fixed
multiple of its input and the cleanup pass after it evicts any overshoot.

Co-Authored-By: DevYukine <20647088+DevYukine@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017BuuZVVtVPNLRaCjTN9bgQ

* feat(converto): let the client pick the download format with ?format=

`?format=zso,iso` lists the formats a client can read. The stored file is
served whenever its format is listed, even with conversion off, so most
emulator clients never trigger a conversion. Otherwise the first listed
format with a cached copy is served, then the first one rom-converto can
produce.

A conversion that outlasts a short wait answers 202 with Retry-After
instead of falling back to the original, so a URL never serves two
different files and a client never gets bytes it can't read. 406 means
no listed format can be served. HEAD reports the same without starting
a conversion. This replaces `?converted=true`, the per-platform download
target and `max_sync_size_mb`; `cache_ttl_hours` stays config.yml-only.

Co-Authored-By: DevYukine <20647088+DevYukine@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017BuuZVVtVPNLRaCjTN9bgQ

* feat(converto): convert the library in place with a manual task

`converto.platform_formats` now names the format a platform's library is
stored in, and the new "Convert library" task brings every matched rom
to it. Each output is staged in a `.romm_tmp_` directory beside the
original, moved into place, and only then are the originals (and a cue's
tracks) deleted. Single-file roms take the new name, folder roms keep
theirs and get their .m3u entries rewritten, and the file rows refresh,
so a rom keeps its id, saves and collections.

Only lossless conversions qualify, so xbox (xiso trims the dump) has no
library format. Unmatched roms are skipped because a converted file no
longer hash-matches a DAT. `/api/config` now carries the library targets
and, per input extension, the formats a download can be converted to.

Co-Authored-By: DevYukine <20647088+DevYukine@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017BuuZVVtVPNLRaCjTN9bgQ

* feat(converto): library format settings and "Download as" on the game page

The settings page follows the reworked backend: per-platform formats are
now the library format the "Convert library" task stores matched games
in ("Leave as is" keeps a platform untouched), the scan metadata, cache
TTL and max-sync fields are gone, and a "Convert library now" button
starts the task behind a typed confirmation, since it deletes the
originals.

The game's More menu offers "Download as <format>" for a single-file rom
when download conversion is on, from the per-extension table
`/api/config` exposes. A one-byte ranged GET asks for the format, the UI
polls through 202s while it converts, then downloads it; a 406 shows an
error.

Co-Authored-By: DevYukine <20647088+DevYukine@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017BuuZVVtVPNLRaCjTN9bgQ

* fix(converto): address code-review findings (pr-ready step 2)

Guard the conversion settings route, add it to the user menu, ignore a
non-positive Retry-After, drop duplicate Download as clicks, name the game
in the persisted error, and tidy the settings page (display-name sort,
useUnloadGuard, decimal cache sizes, save snapshot).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(settings): share the config alerts and save bar (pr-ready step 3)

Extract ConfigFileAlerts and SettingsSaveBar from the three settings
views that copied them, move ScanSettings onto useUnloadGuard, align the
retry slot, and flatten downloadFormats, getDownloadFormats and the
format poll loop.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(converto): trim comments (pr-ready step 4)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(converto): guard destructive tasks and serve download formats per rom

- TaskSpec gains destructive and single_instance. The Tasks list asks for a
  typed confirmation before a destructive task, and POST /tasks/run answers
  409 while a single-instance task is queued or running.
- convert_library is both, and only runnable with ROM_CONVERTO_ENABLED.
- The heartbeat reports CONVERTO.ENABLED, which hides Conversion settings
  from the sidebar and user menu and warns on the page.
- DetailedRomSchema.download_formats lists what the caller can convert the
  rom's single file to, resolved by the backend's own operation table and
  empty for visitors who can't start a conversion. It replaces
  CONVERTO_DOWNLOAD_FORMATS in /api/config and the frontend's copy of the
  extension matching.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Yukine <devyukine@gmx.de>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: DevYukine <20647088+DevYukine@users.noreply.github.com>
2026-10-01 21:46:29 -04:00
Sam Dornan
6941de13db Remove unused code and deduplicate copied helpers (#4975) 2026-09-30 18:51:36 -04:00
Georges-Antoine Assi
5a41e34363 Merge pull request #4953 from rommapp/fix/emulatorjs-player-fixes
fix(player): EmulatorJS multi-disk boot, Safari fullscreen quit, sparse gamepads, netplay audio, mame2003_plus default
2026-09-30 15:16:02 -04:00
Georges-Antoine Assi
f1a98234c2 pr-ready code-review: fix sweep prose and Pair error handling
Repair comments where the em-dash sweep left broken pairs, colon plus
conjunction joins, and misaligned column lists. Block filesystem: in the
pairing callback check, route both Pair views through the shared
errorMessage() helper, and drop the SfcNode comments field the removed
rule used.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 21:29:21 -04:00
Georges-Antoine Assi
978516b5f6 Reject script-capable schemes in the pairing callback
isCustomScheme only rejected http and https, so a javascript: or data:
callback passed the check and ran in the RomM origin with the freshly
exchanged token. Share one check between the v1 and v2 Pair views and
block javascript:, data:, vbscript:, blob: and file: too (CodeQL
js/xss and js/client-side-unvalidated-url-redirection).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 21:12:12 -04:00
Georges-Antoine Assi
efc984f7cd fix(player): default arcade games to mame2003_plus
The mame2003 core bundled with EmulatorJS 4.2.x crashes with
"RuntimeError: unreachable" on many games (EmulatorJS#1030), while
mame2003_plus runs them. A core chosen on the play screen or set in
config.yml default_cores still wins.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 20:45:32 -04:00