Commit Graph

163 Commits

Author SHA1 Message Date
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
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
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
copilot-swe-agent[bot]
d29ed39a6a Add miximage_v2 media type mapping to SS.fr mixrbv2
Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-05-28 20:15:40 +00:00
Cool Contributor
cc13c9efd7 chore: remove obsolete 'version' attribute
Remove the now obsolete 'version' attribute in the example docker compose file.
2026-05-28 11:50:45 +02:00
Allen Lew
76ca0b6ac9 Update config.batocera-retrobat.yml
Exclude the videos directory from scanning
2026-05-17 22:39:37 -07:00
Allen Lew
2c05abda61 Update config.batocera-retrobat.yml
Don't scan the images directory in games
2026-05-11 22:29:16 -07:00
Georges-Antoine Assi
562ec51869 fix batocerya 2026-05-09 10:38:47 -04:00
Allen Lew
8cac076122 Update config.batocera-retrobat.yml
Segacd became megacd with version 42 of batocera (see https://github.com/batocera-linux/batocera.linux/blob/master/batocera-Changelog.md#20251012---batoceralinux-42---papilio-ulysses).  Also don't scan txt files or xml (batocera leaves txt with initial directory and gamelist.xml after a scan)
2026-05-08 21:07:48 -07:00
Georges-Antoine Assi
4928041593 manual cleanu 2026-04-12 11:04:12 -04:00
Georges-Antoine Assi
2dc1678931 changes from bot review 2026-04-06 11:22:44 -04:00
Georges-Antoine Assi
f2619ac0d1 Merge branch 'master' into pegasus-metadata-export 2026-04-06 11:06:08 -04:00
Georges-Antoine Assi
844e4a5d98 comment cleanup 2026-04-05 23:16:49 -04:00
Georges-Antoine Assi
1501f45220 more changes from review 2026-04-05 23:15:42 -04:00
Georges-Antoine Assi
2057c147d9 export true in bato conffig 2026-04-05 22:40:04 -04:00
Georges-Antoine Assi
fafb804bc6 mega cleanup 2026-04-05 22:35:37 -04:00
Vargash
f4c965be33 feat: add new export.gamelist.media.image configuration
also fix broken title_screen/miximage/physical key name usage
2026-03-31 11:16:40 +02:00
Vargash
3e072873e1 feat: new export.gamelist.media.thumbnail configuration 2026-03-31 11:00:49 +02:00
Georges-Antoine Assi
770b8f94ac feat: add Pegasus Frontend metadata export support
Add metadata.pegasus.txt export alongside the existing gamelist.xml
export. Restructure the export system: rename the gamelist endpoint to
a general-purpose export endpoint (`/api/export/`) with sub-routes for
each format (`/gamelist-xml`, `/pegasus`). Move config from flat
`scan.export_gamelist` to nested `scan.export.gamelist_xml` and
`scan.export.pegasus` for auto-export on scan.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 16:09:20 -04:00
copilot-swe-agent[bot]
7f88923dee Add video-normalized support for ScreenScraper scan.media config
Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-03-08 20:30:16 +00:00
Georges-Antoine Assi
cef0ab0422 Update endpoints that use form data 2026-02-18 16:10:45 -05:00
Georges-Antoine Assi
af8cd2d52c Update uses of roms to ROMs 2026-02-09 16:49:22 -05:00
Georges-Antoine Assi
fd2c80061c update batocera platform map 2026-01-29 17:35:32 -05:00
Ricardo van der Heijden
faaf419ef7 Places media section directly under the scan section 2026-01-29 23:14:33 +01:00
Georges-Antoine Assi
d76cd3412b fix tic-80 in batocera config 2025-12-31 14:23:23 -05:00
Zuko
d3b5f5a69c Fix YAML indentation in netplay section of config example file
Corrected the  indentation for the netplay configuration within the config example file.
2025-12-29 21:40:29 +01:00
Georges-Antoine Assi
11cfc7ea43 Add config options to disable batch bootup and auto unload in emujs 2025-12-21 10:50:27 -05:00
Georges-Antoine Assi
9b0311def0 add type suppressions 2025-12-14 14:19:12 -05:00
Georges-Antoine Assi
9584ba9a37 handler can see colocated folders 2025-12-14 13:18:24 -05:00
Georges-Antoine Assi
855dc69fdf update example config.yml 2025-12-10 16:03:42 -05:00
Georges-Antoine Assi
27c83e4736 add config entry to enable netplay 2025-12-08 22:58:48 -05:00
Georges-Antoine Assi
099d58b1e5 add config for netplay 2025-11-26 15:19:45 -05:00
Georges-Antoine Assi
306ab845d1 Merge pull request #2700 from tvdu29/feature/metadata-locale-selection
feat: Add metadata locale selection for IGDB and ScreenScraper
2025-11-26 11:40:56 -05:00