Commit Graph

10731 Commits

Author SHA1 Message Date
Georges-Antoine Assi
c30a02471b cleanup 2026-07-19 20:52:23 -04:00
Georges-Antoine Assi
71b5dfd8f2 Fix wrong error wording for flag-only providers in setup wizard
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>
2026-07-19 19:17:51 -04:00
Georges-Antoine Assi
0d487ad426 Merge pull request #3834 from AlmostEasyGoing/fix-stats-progressbar
(fix) Missing last platform-stats progressbar
2026-07-19 18:36:21 -04:00
Georges-Antoine Assi
9488ceba0e Merge pull request #3167 from tmgast/fix/mod-zip-range-requests
feat: Support Range requests for multi-file ROM downloads
2026-07-19 18:32:12 -04:00
Georges-Antoine Assi
62833ca415 Merge pull request #3211 from LoneAngelFayt/feat/pcsx2-streaming-v2
feat: Emulator streaming
2026-07-19 18:31:34 -04:00
AlmostEasyGoing
3abfeb0e7f Removed unnecessary none-display 2026-07-19 22:28:14 +02:00
Georges-Antoine Assi
c9ee613062 Merge branch 'master' into feat/pcsx2-streaming-v2 2026-07-19 15:59:15 -04:00
Georges-Antoine Assi
adfaf30acd Merge pull request #3831 from rommapp/fix/emulatorjs-save-slot-continuity
fix(player): keep origin save bound and surface save slots in v2 EmulatorJS
2026-07-19 15:56:34 -04:00
Georges-Antoine Assi
f4383e7ec4 fix: avoid overwriting an unpicked save slot when resuming from a state
Only auto-bind a default save as the "Save & Quit" write-back target when
the choice is unambiguous (a single save, or no compatible state armed).
With multiple saves and a state armed, loading the state injects a
different SRAM timeline, so binding an arbitrary user_saves[0] let
Save & Quit PUT over a named slot the user never selected. In that case
leave the save unbound and require an explicit slot pick.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 15:45:17 -04:00
Georges-Antoine Assi
90eaf234b2 Merge branch 'master' into fix/emulatorjs-save-slot-continuity 2026-07-19 15:29:24 -04:00
Georges-Antoine Assi
791ebd942b Merge pull request #3828 from rommapp/fix/v2-clear-selection-after-delete
fix(v2): clear gallery selection after deleting ROMs
2026-07-19 15:28:07 -04:00
Georges-Antoine Assi
5c6fc37c65 cleanup 2026-07-19 15:23:42 -04:00
Georges-Antoine Assi
556fa8fa01 Merge branch 'master' into fix/v2-clear-selection-after-delete 2026-07-19 15:22:06 -04:00
Georges-Antoine Assi
677937e981 Merge pull request #3827 from rommapp/feat/playmatch-custom-url
feat(playmatch): support self-hosted Playmatch instances
2026-07-19 15:21:10 -04:00
Georges-Antoine Assi
8fc0202e79 fix test 2026-07-19 15:16:38 -04:00
Georges-Antoine Assi
496ccbfcbf cleaup 2026-07-19 15:05:51 -04:00
Georges-Antoine Assi
0b74049f38 Merge branch 'master' into feat/playmatch-custom-url 2026-07-19 14:53:19 -04:00
Georges-Antoine Assi
0f5a8e22e0 Merge pull request #3826 from rommapp/posthog-code/generated-metadata-columns
perf(backend): make roms_metadata fast via generated columns
2026-07-19 14:51:59 -04:00
Georges-Antoine Assi
6e5924ce0d remove banchmark script 2026-07-19 14:46:47 -04:00
Georges-Antoine Assi
a912db4235 test(backend): add benchmark for generated metadata columns
Adds tools/benchmark_generated_metadata.py, which times the representative
roms_metadata read workload (rating/date sorts, player-count filter) and,
by default, flips between revision 0097 (derive-on-read view) and head
(generated columns) to print a before/after speedup table against the
same data.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 14:43:00 -04:00
Georges-Antoine Assi
0993c95730 refactor(backend): rename generated metadata columns to generated_ prefix
The STORED generated columns backing roms_metadata used a terse rm_
prefix. Rename them to an explicit generated_ prefix (generated_genres,
generated_average_rating, etc.) and update the alembic autogenerate
filter in env.py to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 14:39:59 -04:00
Zach Clendenen
ef07ea5889 fix(v2): mute global hotkeys while a game owns the keyboard
The g-prefix sequences and the / search shortcut listened during play,
so pressing common game keys (g then h/p/c, or /) navigated away and
killed the session. Gate the handler on the playing store flag.

EmulatorJS set the flag on play but never cleared it on unmount, leaving
pad and hotkey navigation dead after exiting a game. Ruffle never set it
at all, so Flash sessions had no protection. Both players now flag the
session on play and release it on unmount.
2026-07-19 12:06:19 -05:00
Zach Clendenen
549ed33dd7 fix(v2): keep gamepad input with the stream while a session is active
useGamepad gates its pad-to-UI translation on the playing store flag, but
the v2 Stream player never set it, so button presses kept navigating the
app (and a Back/Start press could tear the session down mid-game). Flag
the session while launching or playing and clear it on unmount.
2026-07-19 12:06:16 -05:00
Georges-Antoine Assi
703683a717 fix(playmatch): allow self-hosted origins past SSRF protection
A self-hosted PLAYMATCH_API_URL on a LAN IP, localhost, or a Docker
service name is rejected by the shared HTTP client's SSRF defense before
connecting, so health checks and lookups fail. Add a narrowly scoped
allowlist, derived from the admin-configured provider URL, that both SSRF
gates (the static URL hook and the connect-time backend) honor. The
exception is matched by exact host and port, and the public default URL
is unaffected since public addresses already pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:33:28 -04:00
Georges-Antoine Assi
02f4897979 refactor: drop failed_items from BulkOperationResponse
failed_items was just the length of failed_ids. Remove the redundant
counter from the delete endpoints (roms + firmware) and the response
type; callers that need the count derive it from failed_ids.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:30:01 -04:00
Georges-Antoine Assi
54d07d85b4 fix(player): keep origin save bound and surface save slots in v2 EmulatorJS
Decouple save-file and savestate selection in the v2 player so they are no
longer mutually exclusive. When a compatible savestate exists, the config
screen still opens on the States tab, but the origin save now stays bound
instead of being nulled. This keeps "Save & Quit" updating that save file in
place (PUT) rather than spawning a new slot-less save (POST) that named-slot
sync clients never see.

Surface the save slot as a chip wherever a save renders (config-screen list,
resume preview, and the in-game save picker), guarded so states and slot-less
web saves show nothing. Adds the `play.slot` key across all locales and wires
`slot` into the story fixtures.

v1 (frozen) is left untouched; the change is v2-only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:28:43 -04:00
Georges-Antoine Assi
3ace17a89a fix(v2): snapshot delete-dialog state before awaiting
The delete handler re-read the dialog refs (roms, platform, exclude flag)
after the request resolved. Because the dialog is a singleton, a fresh
showDeleteRomDialog event arriving mid-request could swap those refs, so
the completed request would prune the new dialog's IDs instead of the
ones it processed. Snapshot the state at entry and act on the snapshot.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:15:10 -04:00
Georges-Antoine Assi
25910518f8 fix(v2): keep failed ROMs selected on partial delete
The bulk delete endpoint deletes per-ROM and can partially fail, but the
v2 dialog pruned every requested ROM from the selection and gallery. A
ROM that failed to delete stayed in the library yet lost its selected
state, so the user couldn't retry the failed subset.

Return the failed IDs from the delete endpoints (roms + firmware, both
via BulkOperationResponse) and, on the client, only prune the ROMs that
were actually removed. Failed ROMs stay selected and visible for retry;
the single-ROM route only navigates away when its ROM was deleted.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:13:41 -04:00
Georges-Antoine Assi
0f3cc5660e Merge pull request #3824 from rommapp/fix/v2-gallery-batch-hydration-cap
fix(v2): batch gallery hydration into windows and cap concurrency
2026-07-19 10:30:37 -04:00
Georges-Antoine Assi
b6ea5fc1a8 fixes 2026-07-19 10:16:59 -04:00
Georges-Antoine Assi
4f5a0022af update trunk.yaml 2026-07-19 09:56:14 -04:00
Georges-Antoine Assi
da482e3443 fix(v2): clear gallery selection after deleting ROMs
The v2 delete flow cleared only the legacy v1 selection store
(romsStore.resetSelection()), leaving the v2 gallerySelection store
untouched. Since v2 multiselect and the SelectionBar read from
gallerySelection, the deleted ROMs stayed selected: the bar remained
open with stale rows and re-running a bulk action 404'd.

Drop the deleted IDs from gallerySelection via removeIds so a full
delete closes the bar while a partial delete keeps the rest selected.

Fixes #3822

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 09:26:35 -04:00
Georges-Antoine Assi
cbba8b6259 feat(playmatch): support self-hosted Playmatch instances
Add a PLAYMATCH_API_URL env var (defaulting to the public instance) so
users can point RomM at a self-hosted Playmatch deployment. The handler
now derives all endpoints from this configurable base URL.

Fixes #3820

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 09:26:27 -04:00
Georges-Antoine Assi
dfac9dab2b perf(backend): make roms_metadata fast via generated columns
The roms_metadata VIEW re-derived its facet columns by JSON-parsing up to
eight raw provider-metadata blobs on every roms row, on every query, making
galleries, search, and sorts CPU-bound on large libraries.

Move the per-row derivation into STORED generated columns on roms (rm_*),
maintained automatically by the database engine (no application hook, no
background job). roms_metadata is redefined as a thin projection over them,
so the RomMetadata model, every handler query, and the virtual_collections
view are unchanged and inherit the speedup. Indexes on the release-date,
rating, and player-count columns back the corresponding sorts and filters.

On a 75k-row MariaDB library: release-date sort 1.15s -> 0.05s, facet-value
scan 3.35s -> 0.18s, player-count filter 0.54s -> 0.04s; virtual_collections
4.2s -> 1.3s. Generated columns match the old view byte-for-byte across all
rows except the quoted-string dates the old view silently truncated to 0.

Cross-engine correctness:
- MariaDB JSON_UNQUOTE before every numeric CAST avoids strict-mode INSERT
  truncation on quoted values.
- PostgreSQL to_timestamp()/jsonb_build_array() are only STABLE and illegal
  in generated columns; the gamelist date and age-ratings derivations run
  through IMMUTABLE wrapper functions. Gamelist dates are parsed as UTC on
  both engines so the stored value is time-zone independent.

Fixes #3768.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 09:19:34 -04:00
Georges-Antoine Assi
b3318d0010 Merge pull request #3819 from rommapp/fix/refresh-metadata-update-scan-type
fix(scan): make v2 per-ROM "Update metadata" run the update scan type
2026-07-19 09:06:21 -04:00
Georges-Antoine Assi
f544a317d7 Apply suggestion from @greptile-apps[bot]
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-07-19 09:04:59 -04:00
Georges-Antoine Assi
b524b97e24 docs(i18n): tighten the translate-every-locale rule into bullets
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 09:04:40 -04:00
Georges-Antoine Assi
ff5536a709 fix(v2): guard window fetch by controller identity across apply
A window fetch that was interrupted mid-apply (filter / sort / scan
refresh / context switch clearing `pendingWindows` during a frame yield)
still fell through to `loadedWindows.add(offset)`, so later viewport
syncs skipped the offset and left its cards as permanent skeletons.
`pendingWindows` membership is also ambiguous: a replacement fetch for
the same offset re-adds it, so the stale fetch's `finally` could delete
the new fetch's controller / pending entry.

Guard the whole post-await path by AbortController identity
(`inFlightControllers.get(ctrlKey) === controller`), mirroring the
bootstrap fetch: bail before applying metadata, use it as the
batched-apply relevance signal, re-check before marking the window
loaded and before recording a failure/retry, and only clear our own
bookkeeping in `finally`.

Adds a regression test: invalidating the context mid-apply must not mark
the window loaded, and the fresh context must be able to refetch it.
2026-07-19 09:02:57 -04:00
Georges-Antoine Assi
46f2479ab4 i18n(rom): translate refresh-update-desc into each locale
Replace the English placeholder for refresh-update-desc and
refresh-update-desc-bulk with a proper translation per locale, reusing
each language's established terms for "metadata" and "provider".

Also strengthen the frontend-i18n skill to require real per-locale
translations (not English copies) and add the missing tr_TR entry to
its locale list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 09:02:54 -04:00
Georges-Antoine Assi
53b5b60f27 i18n(rom): unify refresh-update-desc copy across all locales
Set refresh-update-desc and refresh-update-desc-bulk to the same
English sentence ("Re-fetch metadata from the selected providers") in
every locale, replacing the old unmatched-flavored strings. The keys
stay separate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 08:57:04 -04:00
Georges-Antoine Assi
c9ab19ec35 fix(v2): batch gallery hydration into windows and cap concurrency
The v2 gallery hydrated each visible card with its own
GET /roms/{id}/simple request. Fast-scrolling a large library (900+),
especially with multiple users at once, fires dozens of concurrent
requests that funnel through a backend defaulting to a single worker,
overwhelming it until the container recycles/restarts.

Re-batch hydration through the store's windowed fetch:
- Replace per-card fetchRomAt/cancelFetchAt with fetchWindowAt /
  syncVisibleWindows. Each visible position aligns to its shared 72-item
  window and loads via one paginated getRoms; positions in the same
  window collapse to a single request, deduped against loaded/pending
  windows, with out-of-view windows cancelled and failed ones retried.
- GalleryShell.collectVisiblePositions now covers both grid (row) and
  list (list-row) items, so both layouts route through the debounced
  syncFetches -> syncVisibleWindows path.
- GameListRow no longer self-fetches on mount; the shell drives it.

Cap concurrency (MAX_CONCURRENT_WINDOWS = 4): windows over the ceiling
queue and drain as slots free up, so no scroll speed can flood the
backend. The list path is now debounced too (previously grid-only).

Adds a store unit test for the batching and the concurrency cap.

Fixes #3800

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 08:45:18 -04:00
Georges-Antoine Assi
dbb0f4d2e1 fix(scan): make v2 per-ROM "Update metadata" run the update scan type
The v2 RefreshMetadataDialog wired its "Update metadata" option to the
`unmatched` scan type instead of `update`. UNMATCHED only fetches from
providers that haven't matched a ROM yet, so an already-identified ROM
missing derived fields (summary, cover, screenshots) got nothing
repopulated. UPDATE re-fetches by existing provider id and fills those
gaps, which is what the option's label promises.

Repoint the option to `update`, update the type union, default, and
disabled-reset fallback, and correct the two subtitle strings that
described the old unmatched behavior.

Fixes #3801

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 21:41:10 -04:00
Georges-Antoine Assi
b1b73479c5 Merge pull request #3817 from rommapp/fix/igdb-sgdb-series-prefix-matching
fix(igdb): don't match series games to their base title
2026-07-18 21:24:38 -04:00
Georges-Antoine Assi
28bc935869 Merge pull request #3818 from rommapp/fix/device-auth-select-labels
fix(v2): render visible labels on device-auth and token expiry selects
2026-07-18 20:24:22 -04:00
Georges-Antoine Assi
b8d6ec22c6 Merge pull request #3815 from rommapp/fix/verified-badge-hash-match
fix(frontend): base v2 verified badge on real DB hash matches
2026-07-18 19:59:49 -04:00
Georges-Antoine Assi
95a0af561d refactor(frontend): type romVerification helpers with SimpleRom
Use the generated SimpleRom type for the verification helpers instead of
an ad-hoc structural type.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 19:57:43 -04:00
Georges-Antoine Assi
a9ca3e9a7c Apply suggestion from @greptile-apps[bot]
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-07-18 19:53:47 -04:00
Georges-Antoine Assi
5a44db1eae fix(frontend): base v2 verified badge on real DB hash matches
The v2 details "Verified ROM" badge was gated on `crc_hash` being
present, but a hash is computed for essentially every ROM (including
compressed archives that never matched any database). This made the
badge appear on unverified ROMs (#3806).

Introduce `romVerification` as the single source of truth, mirroring
the backend's `_filter_by_verified`: a ROM is verified only when a
Hasheous signature match flag is set. Drive the header badge, the
Metadata-tab per-database chips, and (fixed) the RetroAchievements chip
(`ra_match`, not `ra_id`) from the same shared list, and add the
previously missing WHDLoad / PureDOS databases.

Also clarify what the badge means (#3807): the header tooltip now spells
out that it is a database hash match (Hasheous / RetroAchievements), with
the short label kept as the icon's accessible name.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 19:53:35 -04:00
Georges-Antoine Assi
597f22894c fix(v2): render visible labels on device-auth and token expiry selects
The v2 RSelect/RTextField only render a visible label when `prefix-label`
is set; with just `:label` the text degrades to a placeholder + aria-label.
Because these fields always hold a value, the placeholder never shows, so
no label was ever visible.

Add `prefix-label="stacked"` to:
- the "Token expires in" select (and the "Device name" field beside it) on
  the device authorization screen (DevicePair.vue)
- the "Expiration" select in the create-client-token dialog, which had the
  same latent issue

Fixes #3814

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 19:48:43 -04:00
Georges-Antoine Assi
b1f01ce66b fix(igdb): don't match series games to their base title
Series titles like "Metal Gear Solid: Portable Ops Plus" and the Pokemon
Ranger games were resolved to the same IGDB (and, downstream, SteamGridDB)
entry as their base game, so distinct ROMs became siblings.

The first `_search_rom` pass filters by game_type, which excludes types like
EXPANSION, so a more specific variant is often absent from its candidates.
Jaro-Winkler scores the base title against the searched variant at ~0.99
(well above the 0.75 threshold), so the base was accepted and returned before
the broader search passes ran.

Only trust a first-pass hit outright when it is an exact match or not a
prefix/superset near-miss of the search term. Otherwise widen the search:
re-query without the game_type filter (the reliable recovery for excluded
types) alongside the existing expanded search, then re-rank across the union
so an exact variant outranks the base near-miss. The base stays in the pool,
so it remains the fallback when no better match exists.

Fixes #3805

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 19:48:27 -04:00