Commit Graph

194 Commits

Author SHA1 Message Date
Georges-Antoine Assi
d2b49eeea6 Update examples/config.example.yml 2026-09-27 20:13:04 -04:00
Zach Clendenen
cdf2aba0da feat(streaming): per-platform RetroArch core in the streaming config 2026-09-27 09:49:01 -05:00
Zach Clendenen
d0f801283f style(streaming): field comments above their fields, and the library_path example wording from review
The streaming response models were the only ones using attribute docstrings; they are now # comments above each field like the rest of endpoints/responses. Pydantic never read them (use_attribute_docstrings is unset), so the OpenAPI schema is unchanged.
2026-09-26 13:18:22 -05:00
Zach Clendenen
a91a37214c docs(streaming): make library_path optional in the example config
A webstation container that mounts the library at /romm/library, like RomM,
needs no library_path, so the example comments it out and says when to set
it. The dev compose comment now says why the host-run dev backend still
needs it.
2026-09-25 14:19:57 -05:00
Georges-Antoine Assi
d16aa85968 Merge branch 'master' into streaming-patches-3
AssetList moved its timestamp into <AssetTimestamp> and gained
groupBySlot on master, so the picker's `timestamp` prop now feeds the
component's date and both props coexist. The "updated" | "created" type
and its accessor join Asset's other shared helpers in v2/utils/assets,
where AssetPreview takes them too, since the old local name collided
with the AssetTimestamp component.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-16 19:12:34 -04:00
zurdi
24cd55abe5 feat(player): sync in-game saves seconds after the game writes them
The periodic save upload only ran on EmulatorJS' "System Save interval"
tick (5 minutes by default, never when the player disabled it), and was
off unless emulatorjs.auto_save_sync was set. The player now flushes the
SRAM itself every 5 seconds while the game runs, so the existing tracker
sees a new in-game save on the next two agreeing ticks and uploads it,
and the config flag defaults to on.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MozJiij1oQbu12GvtAPBFR
2026-09-16 19:34:39 +02:00
Zach Clendenen
5e217c7f64 feat(streaming): let an operator declare whether their broker clears saves
The save picker was gated on a hardcoded set of emulators mirroring the
webstation broker's `clears_stale_saves`, a value that lives in another
repo. A broker release that turns it on for a new emulator needed a RomM
code change before the picker appeared, and an operator on a fork or a
newer broker could not turn it on at all. The other direction was worse
because it was silent: if the broker stopped clearing, the pick still
validated, the archive still uploaded, and the container's own newer
files overwrote it with no error anywhere.

`clears_stale_saves` now joins `memory_card_sync` in
PLATFORM_OVERRIDE_KEYS, resolved per container in `_resolve_one`, which
leaves the emulator table as the default rather than the authority. It
also joins the pool-interchangeability check, since the picker is
advertised from the head of the pool and a member that keeps its own
files would take the pick and discard it.
2026-09-15 23:22:27 -05:00
zurdi
1afa59d9de feat: offer Steam as a cover art provider
The cover search dialog only reached SteamGridDB, so a PC game whose
capsule lives on Steam had no way to pick it up short of a full
re-match. Steam now joins SteamGridDB behind `GET /search/cover`,
ordered by the configured cover priority, and each result carries its
provider so the dialog can filter by source and credit the artwork.

The Steam handler builds the picker from the store search alone and
probes the CDN for the portrait capsule and the landscape header under
the same budget the match picker uses, so a slow CDN costs thumbnails
rather than the dialog. Hits with no artwork are dropped.

A failing provider costs only its own covers; a rejected SteamGridDB
key is still reported, since that is the user's to fix. The "search
cover" action in the edit dialog now opens whenever either provider is
enabled, and the game overview credits Steam-hosted covers.

The resource shape the picker consumes moves to the shared base handler
as `CoverResource` / `CoverResult`, since it is no longer SteamGridDB's
alone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Untv32z88QMZ2yRSsTgGcC
2026-09-14 00:35:08 +02:00
Georges-Antoine Assi
2252fb0da3 docs(examples): trim the platform binding comment to one line
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-11 12:13:47 -04:00
Sam Dornan
fec1b3b8d9 docs(examples): cover the wrong-platform case in the binding comment
A folder name that already is a slug never reaches the alias table, so
a binding is needed for those too, not just for names RomM doesn't know.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172ovkiqiK6JgEYCmi3uqe2
2026-09-11 15:36:36 +00:00
Sam Dornan
89ae78887c docs(examples): drop the gc override from the config example
The gc folder is a built-in alias now, so the example demonstrated a
binding that changes nothing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172ovkiqiK6JgEYCmi3uqe2
2026-09-11 15:31:10 +00:00
Georges-Antoine Assi
5d683c72c0 refactor(player): apply simplify pass to the default-core resolution
Drop the console.warn for an unsupported configured core: it re-derived
the check the resolver already makes, and fired on the player's device
rather than where the admin would see it. The example config now points
at the exact core name instead.

Hoist the platform slug in onMounted, name the comment's dependency
rather than its placement, drop a redundant optional chain, and put the
new config tests on a helper matching their neighbours.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-11 09:03:42 -04:00
Georges-Antoine Assi
cf48d371fc feat(emulatorjs): set a default core per platform in config.yml
Add an `emulatorjs.default_cores` block mapping a platform slug to the
core the player preselects for it, so an instance can run DS software on
DeSmuME and DSi software on melonDS without every user picking a core on
every device.

The player resolves its core from the game's remembered core, then the
platform's, then the configured default, then the platform's first
supported core. Each candidate is checked against the cores the platform
actually supports, so an unknown platform or core falls through.

Playing no longer writes the resolved core back to local storage unless
the user picked a different one, so changing the configured default
reaches devices that never made a choice.

Closes #4434

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-11 08:39:55 -04:00
Georges-Antoine Assi
e2952d8769 docs: trim the structure comments in the example config
The docs link carries the grammar and the examples demonstrate it, so the prose
restating both goes. Thirteen comment lines become four.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-08 08:56:06 -04:00
Georges-Antoine Assi
a7ecfd96a9 feat!: make filesystem.structure the single library layout
`filesystem.structure` now spells out the whole layout rather than only the part
below a platform folder. A template is relative to the library root, `{platform}`
marks the platform folder, and `{game}` marks where a game begins.

Merge `{gameFile}` and `{gameDir}` into one `{game}` terminal. The information a
terminal carried was the depth, not the kind: at a declared level a file is a
game of its own and a folder is one multi-file game, which a stat answers. That
drops the two-template idiom for a level holding both, and `_discover_default_roms`
with it, since the default scan is now just `roms/{platform}/{game}`.

Retire the auto-detected `{platform}/roms` layout, along with
`filesystem.roms_folder` and `filesystem.firmware_folder`, which named one path
segment each that a template now contains. Both are refused at startup with the
template that reproduces the layout, so an instance that relied on either says so
instead of scanning an empty library and marking every rom missing. Firmware gets
its own `structure.firmware` key rather than following the rom layout implicitly.

`get_roms_fs_structure` keeps meaning the folder a platform's games start in, so
the `.physical` sentinel paths already in the database still resolve. Per-platform
overrides have to agree with `default` on where the platform folder sits;
relocating one platform needs platform discovery and the watcher to union several
roots, which is left out.

The setup wizard reports `library_ready` plus the configured template instead of
a `struct_a`/`struct_b` discriminator, so the banner shows the layout in force
rather than guessing it client-side.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-08 08:39:21 -04:00
Georges-Antoine Assi
344f810d7f docs: move the library structure reference out of config.example.yml
The comment block explaining `filesystem.structure` had grown to 45 lines of
prose in an example config. Keep the syntax essentials and the examples, and
point at the docs page for the rest.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 21:38:24 -04:00
Georges-Antoine Assi
9dcaf89890 fix: address PR review feedback on library structure and relocation
A grouping folder is no longer also a game. With `{gameDir}` and
`{category}/{gameFile}` declared together, the category folder was surfaced
as a multi-file game *and* descended into, listing its contents twice. A
folder any template descends into is now treated as a grouping level.

Relocation runs for every platform, not only those with a custom structure.
Dropping a platform's template moves every game back to the platform root,
which previously read as a library of new games and orphaned all the saves,
play history, favorites and collection membership. A library whose paths are
unchanged still costs one query and no hashing. This also removes the need
for a manual "apply relocation" toggle.

Physical games are excluded from relocation candidates: they have no file, so
they read as having disappeared from their path on every scan.

A near-miss on the terminal macro (`{gameFolder}` for `{gameDir}`) now names
the offending section instead of only reporting a missing terminal.

Documents two limits the QA pass asked about: a move that also compresses or
extracts the game changes its size and is not detected (the size pre-filter
runs before hashing), and how reverting to the default layout behaves.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 17:01:33 -04:00
Georges-Antoine Assi
4219f56f10 Merge branch 'master' into claude/kind-goodall-0b77y7
Conflict resolution notes:

- Locale rom.json: master sorted and reworked every file; took master's and
  re-inserted `location` / `location-copied` in sorted position. Added them to
  the new tr_TR locale.
- FSRom gained a required `fs_path`, so `build_hashless_fs_rom` now takes one
  and both call sites pass the rom's own path.
- `get_roms` keeps this branch's `_collect_fs_roms` discovery while adopting
  master's one-pass build and in-place sort.
- `mark_missing_roms` takes full paths and now also excludes physical games
  (master), and the scan loop keeps master's early missing-sync plus its
  restored-rom emit alongside this branch's relocation pass. The relocation
  filter now applies only to the identify loop, so a relocated rom is no longer
  re-flagged missing at the end of the scan.
- Relocation writes rom files through master's `sync_rom_files` (which replaced
  `purge_rom_files` / `add_rom_file`), so row ids and track metadata survive.
- Master's unique index on (platform_id, fs_name) contradicts this branch's
  premise that same-named files in different folders are distinct games.
  Migration 0126 widens it to (platform_id, fs_path, fs_name); physical games
  all share one folder, so a duplicate title is still rejected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 16:24:59 -04:00
Georges-Antoine Assi
eb7d72a500 Merge remote-tracking branch 'origin/master' into perf/scan-workers-default
# Conflicts:
#	examples/docker-compose.example.yml
2026-09-07 14:23:47 -04:00
Georges-Antoine Assi
3767d1b5b9 cleanup 2026-09-07 14:17:56 -04:00
Georges-Antoine Assi
7365d17738 cleanup 2026-09-07 14:15:25 -04:00
Spinnich
e090574eff perf(scan): default to 4 scan workers instead of 1
Hashing 1.96 GiB of real ROM files is 2.2x faster at 4 concurrent
workers than at 1 (108 -> 240 MiB/s on 16 cores, 108 -> 264 MiB/s
pinned to 4 cores). Pinned to 2 cores it is still 1.6x, so the new
default costs nothing on small hosts.

Metadata providers cap themselves independently of this value, so the
extra workers queue rather than exceed an allowance: ScreenScraper holds
a concurrency limiter set to the account's advertised thread count, and
the other adapters pace their own request rate. Database work in the
scan path is synchronous on the event loop, so it serializes regardless
and the connection pool is unaffected.

The compose example advised one worker per CPU, which overshoots on a
large host. Both it and env.template now say what raising this actually
buys, since metadata is paced no matter how many workers there are.

Only installs that never set SCAN_WORKERS move; any explicit value is
preserved.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 17:56:27 +00:00
Spinnich
003dfe2d06 docs(env): replace the WEB_SERVER_CONCURRENCY worker heuristic
"2 x CPU cores + 1" is gunicorn's guidance for sync workers. RomM runs
UvicornWorker with sync endpoints served from Starlette's threadpool, so
the rule does not transfer: on a 16-core host it measured 3x slower than
4 workers and cost 5.31 GB PSS.

The variable also only reaches the gunicorn API server; background tasks
run in the separate RQ worker processes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 16:43:43 +00:00
Georges-Antoine Assi
8fec86caa3 refactor(player): compare save bytes instead of hashing them
Change detection needs equality, not a fingerprint, and the hash was the
only reason the tick handler was async. Comparing bytes drops the WebCrypto
call, its non-secure-context fallback, and both mid-flight liveness checks
the awaits had made necessary: the decision now runs before the upload with
nothing suspended in between.

Seeding reads the SRAM with getSaveFile(false), which skips the dump that
was firing a saveSaveFiles tick, so the subscription no longer has to be
ordered below it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 12:00:06 -04:00
Georges-Antoine Assi
80a9c98979 refactor(player): one gate for the save sync subscription
The active flag and the install slot both said "this component still owns
the subscription", so the slot alone now carries it.

fnv1a64's second lane re-hashed the same bytes offset by one with the same
prime, leaving the halves correlated; distinct primes over a single load
drop the per-byte modulo too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 11:44:05 -04:00
Georges-Antoine Assi
1443f66cf5 Merge branch 'master' into feat/auto-save-sync 2026-09-07 10:24:48 -04:00
f0rthelulz
e1e4663521 feat(player): optional periodic upload of changed save files
Behind a new config flag, emulatorjs.auto_save_sync (default false), the
EmulatorJS player uploads the in-game save (.srm) to the server on
EmulatorJS' own "System Save interval" tick, without Save & Quit.

EmulatorJS already runs that timer (default 300 s) and its
gameManager.saveSaveFiles() fires a "saveSaveFiles" event carrying the
SRAM bytes, but nothing listens to it, so today an in-game save reaches
the server only from Save & Quit or the Export Save File button (#4201).
This subscribes to that event from Player.vue and uploads through the
existing saveSave() when the SRAM hash is unchanged since the previous
tick (a save the core is still writing is never uploaded — the corruption
the earlier automatic upload was removed for, #2349) and differs from the
last upload (an idle session uploads nothing). The tracker is seeded from
the SRAM the core holds after the server save is applied, so a launch
never uploads the server's own file back, and the subscription is turned
off before Save & Quit, Quit and unmount.

The bytes EmulatorJS hands out are views onto the emulator heap, a
SharedArrayBuffer on threaded cores; they are copied into a plain
ArrayBuffer before hashing or uploading.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-06 11:37:33 -05:00
Sam Dornan
08c9d1862b fix(export): merge gamelist.xml and metadata.pegasus.txt instead of overwriting
Both exporters rebuilt their file from the database on every run, so a
scan with `scan.gamelist.export: true` threw away everything the frontend
or the user had written into it: favorites, play counts, per-game
emulator and core overrides, hashes, `<folder>` entries, ES-DE's
`<alternativeEmulator>` block, and Pegasus launch commands.

The exporters now read the existing file first and merge into it. For a
ROM RomM knows, the tags and keys RomM emits replace the old ones and
everything else is carried over. Entries with no matching ROM, folders,
scraper provider blocks and later Pegasus collections are written back
untouched. A file that cannot be parsed or decoded is left alone and the
export for that platform fails instead of replacing it.

Fixes #4158

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XjH6MYLVFVoY92JdBFgKXw
2026-09-06 01:17:38 +00:00
Georges-Antoine Assi
17176832dd docs(streaming): trim the config example's streaming preamble
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-05 17:47:02 -04:00
Georges-Antoine Assi
15233afcb1 Merge branch 'master' into feat/streaming-webstation
Conflicts and how they were resolved:

- `useGameActions`: master renamed `useCanPlay`'s `canPlay` to `canPlayLocal`
  and kept a local `canPlayStream`, while this branch moved `canPlayStream`
  into `useCanPlay` and folded it into `canPlay`. Kept this branch's shape and
  took master's `useScanTrigger()` call.
- `Player/Stream.vue`: kept this branch's force-release and session-poll block,
  and re-placed master's `useUnloadGuard(sessionActive)` next to the
  `sessionActive` watch.
- `locales/*/play.json`: kept both sides' keys, re-sorted.
- `__generated__/index.ts`: kept both sides' model exports, re-sorted.
- `test_config_loader.py`: kept both sides' tests.

Master took 0114 through 0118 while this branch was open, so its three
migrations are renumbered 0119-0121 and rechained after
`0118_rom_category_cheat_pg`, leaving alembic with a single head.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-05 07:49:12 -04:00
Georges-Antoine Assi
80185b225c refactor(scan): resolve platform folder names in both directions
Fold the folder name resolution into one home and make it case-insensitive
end to end.

Config folder names are lowercased as the config is parsed, so bindings,
versions and the built-in alias table are all matched the same way. A SNES/
folder now resolves, and a binding written GameCube: matches a gamecube/
folder.

Add resolve_fs_slug(), the inverse used to recover a renamed folder, which
replaces the two swapped dicts in scan_platform. Only slugs reached by
exactly one folder name are reversible, so recovery never guesses between
amiga500, amiga600 and amiga1200.

Validate system.platforms and system.versions through one helper that
rejects empty and non-string values, and treat a null block as empty rather
than exiting.

Restore the atari800 override in the example configs: its folder name is
itself a RomM slug, so it can never be an alias. A new test derives the
needed overrides from the alias table to keep the examples honest.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-04 17:32:07 -04:00
Sam Dornan
994fddcbe5 feat(scan): resolve Batocera, RetroBat and ES-DE folder names to platforms
Frontend system folders such as gamecube, megadrive or n3ds only became
RomM platforms after the user copied a 100+ line system.platforms map into
config.yml. A built-in alias table now covers the folder names those
frontends use, seeded from the two example configs and cross-checked
against the upstream system lists.

Resolution order is unchanged for existing users: config bindings and
versions win, a folder name that already is a slug keeps matching itself,
and only then is the alias table consulted. The two call sites that
resolved folder names by hand share one resolver.

The example configs shrink to genuine overrides. The Batocera example
also mapped odyssey2 to the original Odyssey; the alias points at
Odyssey 2.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-04 10:59:20 -05:00
Georges-Antoine Assi
7036ae0e9c Merge remote-tracking branch 'origin/master' into feature/sigil-title-ids 2026-09-02 16:34:48 -04:00
Zach Clendenen
6915eeb26e feat(streaming): config plumbing for webstation containers
Extends the streaming container config so one container can serve many
platforms, adds the webstation protocol and subfolder keys, and warns
when a config still uses the deprecated per-emulator broker mods.

Also pins DB_NAME to a dedicated test database so the autouse
clear_database fixture can never wipe a real dev database.
2026-08-30 22:41:36 -05:00
Georges-Antoine Assi
e7c4cb2ab6 refactor(scan): tighten the sigil title id extraction paths
Quality pass over the title id feature, no behaviour change.

Give the Switch platform family one home by deriving it from the sigil
slug map, and drop the two inline tuples and the local frozenset that
restated it. Express the base-title-id rule once: a base id is its own
derived base. Compose the bracket regex from the 16-hex pattern instead
of repeating it.

Return the embedded name from the extraction closure rather than writing
it through nonlocal, which removes the is_rom_level flag and the repeated
sigil_platform guards, and factor the twice-duplicated rom-level file
tail into one helper.

Cut two per-ROM costs in _identify_rom: config.yml was re-read and
re-parsed three times per ROM, and the prod.keys firmware lookup ran one
DB query per Switch ROM despite depending only on the platform. Both are
now resolved once, the latter in the per-platform callers.

Also document skip_title_id_extraction and embed_switch_title_ids, drop
the always-dashed title/save id rows from the metadata tab, and render
the file row's chips from one list.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-28 18:18:47 -04:00
Sam Dornan
6a8cb34645 feat(steam): add the Steam storefront as a metadata provider
Steam covers the PC platforms RomM otherwise has thin metadata for, and
its store payload is provider-grade on its own: title, description,
portrait capsule art, screenshots, genres, developers, publishers,
release date and Metacritic score, with no API key.

Valve documents no storefront API, so this reads the two endpoints that
back the store's own search box and app pages, paced well under the ~200
requests per 5 minutes they tolerate. Every failure path degrades to "no
match" rather than aborting a scan, and the provider is opt-in behind
STEAM_API_ENABLED, matching HowLongToBeat and Flashpoint.

Matching is gated on the platform slug so the three PC platforms are the
only ones that spend a request. The storefront's search index carries
DLC, soundtracks and tools alongside games, so hits are filtered by type
and then confirmed against the app page, which is the only place a demo
or a video is distinguishable from a game. A (steam-12345) filename tag
pins a match by hand when the title is ambiguous.

SteamMetadata reuses the key names the other providers already use for
the values they share, so wiring Steam into the generated facet columns
later is a SQL change with no stored-row reshaping.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-22 13:35:42 -05:00
danblu3
6020793b11 Changed default compose, will explain more in pull 2026-08-15 17:22:40 +00:00
Ryan McClelland
bee884a371 fix(config): map tic80 to the tic-80 platform slug
The Batocera example bound the tic80 folder to "tic", which is not a
platform slug RomM knows. A binding to an unknown slug still applies, so
the platform is created with that slug, matches no metadata provider, and
is named from the string itself rather than being identified.

The real slug is tic-80.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-03 12:14:42 -07:00
Georges-Antoine Assi
fa63d7b5b5 Merge pull request #3917 from rommapp/feature/scan-region-mode
Add scan.priority.region_mode to let config regions drive media selection
2026-07-23 18:11:18 -04:00
Georges-Antoine Assi
47fb79630c cleanup 2026-07-23 17:11:23 -04:00
Georges-Antoine Assi
6666019ce5 Stop duplicating fanart and title_screen into screenshots
ScreenScraper scraping added the fanart and title-screen URLs to
url_screenshots even though the same images are persisted to their
dedicated fanart/ and title_screen/ media folders, downloading and
storing every image twice. Restrict url_screenshots to the actual
screenshot media type; the dedicated media still renders in the artwork
gallery. The gamelist handler had the same pattern with title_screen
and gets the same fix.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 16:47:22 -04:00
Georges-Antoine Assi
67eab49a72 Add scan.priority.region_mode to prefer config regions for media
New opt-in config key scan.priority.region_mode with values
prefer_rom_tags (default, current behavior) and prefer_config. With
prefer_config, the configured region priority outranks the rom's
filename region tags when selecting ScreenScraper media, and the rom's
own tags remain the fallback when the configured regions have no media.
Unknown values warn and fall back to prefer_rom_tags, and the key
survives runtime config-file rewrites.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 16:46:38 -04:00
Georges-Antoine Assi
2f28da980a feat(platforms): add windows9x support
Adds a `win9x` universal platform slug, mapped to ScreenScraper system
137 (PC Win9X), so Windows 9x libraries can be scanned and matched.

The ES-DE config example gains the `windows9x` folder mapping, plus the
`windows3x` mapping that was missing.

Closes #3875

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 07:26:37 -04:00
Georges-Antoine Assi
f9684a6faa cleanup comments 2026-07-19 19:46:28 -04:00
Georges-Antoine Assi
096346a981 feat(scan): per-field artwork priority overrides
Add optional scan.priority.cover / screenshot / manual keys that each
override scan.priority.artwork for a single artwork field, falling back
to the shared artwork priority when omitted. This lets users, for
example, keep original box art for covers while sourcing screenshots
from a different provider.

Backward compatible: absent keys leave behavior unchanged. Config-only
(no UI), read-only exposure via GET /api/config.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 18:56:47 -04:00
Zach Clendenen
a6e8cd75ed feat(streaming): add emulator streaming backend
Add /api/streaming endpoints for session claim/release, ROM launch,
save states, volume control, and save-and-exit against per-platform
emulator broker containers. Sessions are stored in Redis with atomic
SET NX claims, owner-bound, and admin force-releasable. Config comes
from config.yml (streaming.enabled + containers list) with a
STREAMING_SAVE_TIMEOUT env override for slow-saving brokers.

Includes 19 endpoint tests covering auth scopes, claim races,
ownership, broker failure paths, and force-release.
2026-07-08 17:38:04 -05:00
Claude
ef7f91d643 Merge remote-tracking branch 'origin/master' into claude/kind-goodall-0b77y7
# Conflicts:
#	frontend/src/locales/bg_BG/rom.json
#	frontend/src/locales/cs_CZ/rom.json
#	frontend/src/locales/de_DE/rom.json
#	frontend/src/locales/en_GB/rom.json
#	frontend/src/locales/en_US/rom.json
#	frontend/src/locales/es_ES/rom.json
#	frontend/src/locales/fr_FR/rom.json
#	frontend/src/locales/hu_HU/rom.json
#	frontend/src/locales/it_IT/rom.json
#	frontend/src/locales/ja_JP/rom.json
#	frontend/src/locales/ko_KR/rom.json
#	frontend/src/locales/pl_PL/rom.json
#	frontend/src/locales/pt_BR/rom.json
#	frontend/src/locales/ro_RO/rom.json
#	frontend/src/locales/ru_RU/rom.json
#	frontend/src/locales/zh_CN/rom.json
#	frontend/src/locales/zh_TW/rom.json
2026-06-23 02:00:27 +00:00
Claude
f7f0ca9c2c feat: allow a list of structure templates per platform (union discovery)
A single fixed-depth template can't describe a platform that holds loose
games in its root AND organizes others into grouping subfolders — `{gameFile}`
drops the grouped games, `{category}/{gameFile}` drops the loose ones. Let a
platform's `filesystem.structure` value be a list of templates; discovery is
their union, deduplicated by full path:

  structure:
    nes:
      - "{gameFile}"             # loose top-level games
      - "{category}/{gameFile}"  # games inside grouping subfolders

- config: accept str | list[str]; platform_structure() returns a tuple of
  parsed structures; parse_platform_structures() + validation handle both forms.
- fs handler: _collect_fs_roms unions each structure's discovery, dedup by
  (fs_path, fs_name).
- tests: list parsing, per-platform list config loading, and the mixed
  loose+grouped discovery case.
- docs: config.example.yml leads with the mixed-layout list example.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sk2dzM3K9qxWBdPAeGb7us
2026-06-23 01:45:07 +00:00
Claude
77980a79ec feat(v2): interactive 3D box art on game detail hero
Adds an RBox3D primitive that builds a rotatable, fake-3D game box from
three flat ScreenScraper scans (front, back, spine) using CSS 3D
transforms. Box proportions derive from the images themselves; it rotates
via pointer drag, arrow keys / gamepad D-pad, and the right analog stick,
drifts gently when idle, and honours prefers-reduced-motion.

The game detail hero (CoverColumn) upgrades to the spinning box when the
"3D box" boxart style is selected and the rom has the full set of faces,
falling back to the flat cover otherwise.

Backend: persist the box-2D-side (spine) scan locally, mirroring the
existing box-2D-back handling — new BOX2D_SIDE media type + box2d_side_path
on ss_metadata, opt-in via scan.media.

- RBox3D primitive + Storybook story (controls + keyboard-rotation play())
- useBoxFaces composable resolving the three faces + a `complete` gate
- box3d-alt i18n key across all locales
- backend BOX2D_SIDE persistence + tests

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019itLXRfJXGGbhPY3JyqnuN
2026-06-22 21:45:39 +00:00
Claude
b5f457b53a feat: replace subfolder flag with per-platform custom library structure
Generalizes the opt-in subfolder scanning into a per-platform custom
library structure template, modeled on Retrom's. Replaces the
`scan.subfolders` (bool | list) flag with `filesystem.structure`
(fs_slug -> template); platforms without a template keep RomM's default
discovery (top-level files and folders), so existing setups are unaffected.

A template is relative to the platform's ROM folder (RomM already resolves
the library root, roms_folder and platform directory) and is a sequence of
`/`-separated path sections:

  - a braced section is a macro, a bare section is a literal folder matched
    exactly;
  - the last section must be the terminal {gameFile} (each file is a game) or
    {gameDir} (each folder is a single multi-file game);
  - any other braced section ({region}, {category}, ...) is a wildcard
    directory level that matches any folder (organizational only).

Examples:
  filesystem:
    structure:
      nes: "{category}/{gameFile}"   # roms/nes/Hacks/foo.nes
      ps3: "{category}/{gameDir}"    # roms/ps3/PSN/Game/
      snes: "{region}/{gameFile}"    # roms/snes/USA/foo.sfc

Declaring {gameFile} vs {gameDir} removes the previous disc-descriptor
guessing entirely — the user states file-vs-folder. Hidden (dot-prefixed)
folders are never descended into. Hash-based non-destructive identity
(relocate a moved/renamed game in place, preserving saves/history/favorites/
collections) is retained and now triggers for any platform with a custom
structure.

- config: parse + validate templates at load (parse_library_structure,
  LibraryStructure); reject {platform}/{library} (RomM resolves those) and
  malformed templates.
- fs handler: _discover_structured_roms walks literal/wildcard levels to the
  terminal; _discover_default_roms preserves the default behavior.
- Tests: template parser (valid/invalid), per-platform config loading, and
  structured discovery (wildcard/literal levels, file/dir terminals, depth>1,
  hidden-folder skip, cross-folder name collisions). Subfolder-flag tests
  replaced.
- Docs: config.example.yml documents filesystem.structure; scan.subfolders
  removed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sk2dzM3K9qxWBdPAeGb7us
2026-06-21 22:01:05 +00:00