Expose the scan.* section of config.yml (metadata & artwork priority,
per-field artwork overrides, region priority, language priority, media
types, gamelist and pegasus export) in an editable v2 Settings page.
Backend:
- Add PUT /api/config/scan (platforms.write) with a validated
ScanSettingsPayload and ConfigManager.update_scan_settings().
- Expose GAMELIST_AUTO_EXPORT_ON_SCAN and PEGASUS_AUTO_EXPORT_ON_SCAN
in ConfigResponse / GET /api/config.
- Preserve the streaming section on runtime config writes (previously
dropped on every write).
Frontend:
- New Settings/ScanSettings.vue page + ScanPriorityList.vue reorderable
list (drag + up/down for keyboard/gamepad); region/language use
RComboboxField.
- Wire the scan-settings route, permissions, and sidebar entry.
- Regenerate OpenAPI types; add all new strings to every locale.
Closes#3849
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Several endpoints authorized cross-user access by the is_public flag (or
by scope alone for streaming) without re-checking whether the parent ROM
or platform is hidden from the caller. A user blocked from a ROM/platform
could still download a public save/state/screenshot attached to it, or
claim a streaming session for it, by supplying the asset/ROM id directly.
Route all four through the existing assert_rom_visible() 404-masking
helper, right after loading the record and before any file access or
broker launch, matching the ROM detail/content endpoints.
- saves.py / states.py / screenshots.py download_* : public sharing no
longer overrides the hidden-resource boundary.
- streaming.py claim_session : hidden ROM/platform can no longer be
launched via its id; broker is never contacted.
Regression tests cover hidden-ROM and hidden-platform cascade for each
endpoint, plus a positive control that public sharing still works when
the ROM is visible.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Requiring mapping === "standard" rejected legitimate controllers that
report an empty mapping (some Switch Pro, Joy-Con, 8BitDo browser/OS
combos) while still exposing the standard button indices, breaking
navigation for them. There are only two mapping values, so the check
dropped every empty-mapping device. Gate on pad.connected alone, which
is the actual discriminator for the disconnected phantom entries that
caused #3851.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The v2 gamepad polling loop reads buttons and axes by hardcoded W3C
standard-mapping indices, but only guarded against null pads. Firefox
(and Zen) expose phantom or non-standard-mapping gamepads even with no
real controller attached, whose analog controls drift across the press
threshold. Index 4/5 (LB/RB) are bound to AppNav section cycling, so
each oscillation re-fired cycleSection and looped the app through
home/platforms/collections/search with no user input, making the UI
unusable.
Add an isUsablePad() guard requiring pad.connected and a "standard"
mapping, applied in both the polling loop and detectPadPresence. Every
button/axis read assumes the standard mapping, so a non-standard pad
cannot be interpreted safely regardless.
Fixes#3851
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The greptile suggestion added encodeURIComponent to the selected file
name in getDownloadPath, but the test still expected a literal space.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The ROM update API accepts any non-empty string in flashpoint_id. A value
containing `#` or `?` would be parsed as a URI fragment/query, launching the
wrong title. Gate both the action's visibility and the launch on a UUID match.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A platform folder created on disk (optionally bound in Library
Management) has no database row until its first scan imports a ROM, so
it was invisible to the scan platform picker and a first scan could not
be triggered for it. The picker also filtered to rom_count > 0, hiding
even zero-ROM database platforms (e.g. those created via romm-cli).
Backend:
- Add GET /platforms/filesystem returning folders on disk without a
database row yet (locally-resolved metadata, id -1, rom_count 0).
- scan_platforms / the scan socket now accept platform_fs_slugs so a
folder can be scanned by slug; database platforms stay accepted by id.
Frontend (v2):
- Fetch filesystem folders, key the scan picker by fs_slug, include
zero-ROM database platforms, and tag never-scanned folders.
Fixes#3832
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A slot-less POST /api/saves behaves as a filename upsert, and two
details combined into silent save corruption.
1. get_save_by_filename only filtered by slot when one was passed, so a
slot-less lookup could match (and overwrite) a save row living in a
named slot. Scope slot=None to the null-slot save (Save.slot IS NULL)
so a slot-less upload can never adopt a row from another slot.
get_save_by_content_hash keeps its documented cross-slot slot=None
behavior (dedup-only, non-destructive).
2. The upsert branch only wrote file_size_bytes and content_hash while
the bytes landed under a path derived from the request's emulator, so
the row's hash could disagree with the file it still pointed at. Also
persist file_path/emulator, and remove the now-orphaned file when the
row's location changes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a v2 game action that hands a ROM's flashpoint_id to the OS
`flashpoint://` protocol handler so the locally installed Flashpoint
launcher starts the title. The action only appears when the ROM has a
flashpoint_id.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bulk_mark_present issued an unconditional UPDATE setting missing_from_fs=False
on every matched row, including rows already present. Since Rom.updated_at has
onupdate=utc_now, every scan re-stamped all skipped/unchanged ROMs of a
platform, defeating updated_after-based incremental consumers and busting every
cover URL (?ts={updated_at}) on each scan.
Mirror the missing-side guard (mark_missing_roms) by restricting the UPDATE to
rows that actually flip via Rom.missing_from_fs.is_(True), so an unchanged
platform issues no updates.
Fixes#3836
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Multi-file roms (e.g. multi-disk Amiga games) failed to launch in the
EmulatorJS player with "Unsupported file format: ''", while single-file
roms on the same platform worked.
EmulatorJS derives the on-disk filename it writes to the emulator FS from
the last path segment of the game URL, and the core determines the disk
format from that filename's extension. getDownloadPath used the ROM-level
fs_name for that segment. For multi-file roms the rom is a folder, so
fs_name has no extension, and the core received an extension-less file.
When a single file is selected, use that file's real name (extension
included) as the content path segment instead of fs_name. The backend
already serves the correct file for a single file_ids value and only uses
the path segment for zip/m3u naming, so multi-file and no-selection cases
are unchanged.
Fixes#3746
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move the getOpenRooms and io-wrap overrides to the top of EJS_onGameStart so
they are installed synchronously, before room polling or a Create/Join action
can start, rather than at the tail of the callback.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The setup wizard's metadata step showed "API key invalid" for any
enabled provider that failed its heartbeat probe, including flag-only
providers like PlayMatch and Hasheous that have no API key. This
contradicted the Settings > Metadata sources view, which already adapts
its wording per provider.
Mirror that behavior: add a `requiresKey` flag to each source and use
connection-oriented wording for flag-only providers ("Unreachable" on a
failed probe, "Provider disabled" when off) instead of key-oriented
wording. Reuses existing locale keys, so no new translations are needed.
Fixes#3795
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The v2 gallery refetch watcher in GalleryShell only watched the filter
selection arrays, not the per-filter logic operators (any/all/none).
Toggling a filter to the inverse ("none") updated the store but did not
trigger a refetch, so the results only changed when the selection itself
was edited or after a reload (URL hydration re-runs the initial fetch).
Watch all *Logic operators alongside their selections so inverting a
filter (e.g. statuses -> "none") refetches immediately.
Fixes#3798
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Unknown provider slugs in scan.priority.cover/screenshot/manual are
already dropped by the downstream availability filter, so they never
crash a scan, but they silently did nothing. Surface likely typos with
a load-time warning, consistent with scan.media handling. A drift-guard
test keeps VALID_SCAN_PRIORITY_SOURCES in sync with MetadataSource.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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>
RomM's netplay overrides targeted an outdated EmulatorJS API, so on the
nightly build they were dead code and the emulator's own URL logic ran.
That built the room-list request from `netplay.url` (the page host with no
scheme), which resolved relative to the SPA route and duplicated the domain
inside the path. nginx's SPA fallback then answered with index.html, so the
room list was always empty. The socket also used the default socket.io path
instead of RomM's mounted /netplay/socket.io.
- Set EJS_netplayServer to window.location.origin (scheme included).
- Override netplay.getOpenRooms on the current netplay instance to hit
/api/netplay/list with a root-relative path.
- Wrap the EmulatorJS-bundled global io to inject the /netplay/socket.io path.
Fixes#3799
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>