Commit Graph

11381 Commits

Author SHA1 Message Date
Matt Van Horn
86d8aea09c fix: Preserve nested arcade ROM filenames
Fixes #1893
2026-08-22 21:16:35 -07:00
Georges-Antoine Assi
41b307f00f Merge pull request #4266 from rommapp/dependabot/npm_and_yarn/frontend/brace-expansion-2.1.4
chore(deps-dev): Bump brace-expansion from 2.0.3 to 2.1.4 in /frontend
2026-08-22 15:55:03 -04:00
Georges-Antoine Assi
e3080c9fb3 Merge pull request #4264 from tmgast/perf/roms-list-per-page-work
Fix N+1 and entity sort in GET /api/roms
2026-08-22 15:54:44 -04:00
Georges-Antoine Assi
80dff4f7cf refactor(roms): fold the rom list test fixtures onto shared helpers
Three fixtures rebuilt the Rom literal that _add_rom already assembles, and
the RomFile boilerplate repeated six times. Adds _add_file, drops the
dict[str, object] cast that forced a type: ignore, and trims the comments.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 15:46:20 -04:00
Georges-Antoine Assi
b2581bf7ec chore(alembic): rechain the rom_files category index after 0108
master landed 0108_roms_primary_region on the same parent, so the index
migration moves to 0109 and revises that one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 15:19:39 -04:00
Georges-Antoine Assi
217623a0c6 Merge remote-tracking branch 'origin/master' into perf/roms-list-per-page-work 2026-08-22 14:34:42 -04:00
Georges-Antoine Assi
6a25a21656 Merge pull request #4263 from sdornan/claude/compassionate-chatelet-c7bcc7
refactor(v2): give the metadata provider taxonomy one home
2026-08-22 14:33:24 -04:00
Georges-Antoine Assi
87638807c7 refactor(v2): give the grouped provider sections one home
Each of the three provider surfaces had hand-rolled the same section
labels and the same order-and-partition block. The setup wizard's step
and the scan info dialog held byte-identical `GROUP_LABELS` maps, so
those move to `SETUP_GROUP_LABELS`, and the partition becomes
`groupProviders()` with a unit test. The settings view keeps its own
labels, since its `settings.*` keys and section icons differ.

Trims the comments that explained the taxonomy instead of recording what
the code cannot say.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 12:39:02 -04:00
Georges-Antoine Assi
57badfd626 Merge pull request #4262 from sdornan/claude/beautiful-colden-2f5983
fix(hltb): keep a pinned HowLongToBeat match through a rescan
2026-08-22 12:04:22 -04:00
Georges-Antoine Assi
14afa111b1 test(hltb): drop the unused Playmatch patch from the scan tests
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 11:36:15 -04:00
Georges-Antoine Assi
7f8f87e538 refactor(hltb): inline the HowLongToBeat match resolution
The helper had a single caller, so the stored-ID branch now sits in
fetch_hltb_rom like the Flashpoint and MobyGames fetchers. Its tests move
with it and drive the same six cases through scan_rom.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 11:27:54 -04:00
Georges-Antoine Assi
d698ecd97c Merge pull request #4261 from sdornan/claude/auto-collection-count-bug-e07d62
fix(frontend): keep collection ROM counts in step with the gallery
2026-08-22 11:11:25 -04:00
Georges-Antoine Assi
97f2c3daa5 chore(frontend): trim the collection refresh comments
Cut the rationale that was repeated at every caller down to one line on
the store method, drop the change-history comment from the store test,
and narrow errors with `axios.isAxiosError` the way the rest of the
frontend does instead of a hand-written cast.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 10:51:40 -04:00
Georges-Antoine Assi
3ccf901de6 Merge pull request #4260 from sdornan/feat/region-priority-default-sibling
feat(gallery): pick a game's default version by region priority
2026-08-22 10:20:18 -04:00
dependabot[bot]
371a383d65 chore(deps-dev): Bump brace-expansion from 2.0.3 to 2.1.4 in /frontend
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 2.0.3 to 2.1.4.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v2.0.3...v2.1.4)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 2.1.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-22 13:46:29 +00:00
Georges-Antoine Assi
db9f61c1f5 Merge pull request #4254 from sdornan/claude/starlette-upgrade-591133
chore(deps): bump starlette from 1.0.1 to 1.6.0
2026-08-22 09:44:03 -04:00
Georges-Antoine Assi
6aa1c69252 Merge pull request #4252 from sdornan/claude/server-stats-platform-links-ea2921
feat(v2): link Server Stats platform rows to their platform
2026-08-22 09:37:10 -04:00
Georges-Antoine Assi
6101d1c4a7 Merge pull request #4251 from rommapp/fix/4248-v2-core-persistence
fix(v2): remember the core a game was launched with
2026-08-21 19:53:59 -04:00
nendo
1c40160201 test(roms): pin the derived file stats to the subqueries they replace
The with_files path computes multi_file, top_level_file_count and
has_soundtrack in Python; the other path reads them from correlated
subqueries. The differential test asserts both answer the same for a
flat file, a folder with two top-level files, a nested single file, a
soundtrack folder and a rom with no files at all, so neither predicate
can be edited without the other.

Also assert a rom's files load in a fixed number of queries rather than
one per file.

Claude-Session: https://claude.ai/code/session_01J1pbRJBY3PatzkB5skQNEU
2026-08-22 08:49:42 +09:00
Sam Dornan
9617d6de3a fix(v2): stop metadataProviderGroup classifying prototype members
`in` walks the prototype chain, so metadataProviderGroup("toString")
returned the inherited function rather than undefined, breaking the
declared return type. Object.hasOwn keeps the lookup to the map's own
keys.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 18:47:08 -05:00
Sam Dornan
f81d5115a0 refactor(v2): make the proxy group's exhaustiveness real
MetadataProviderKeyIn claimed a consumer would get a compile error when
a group grew a member, but the hash-matcher code branched on the key:
setHashMatcher treated every non-Hasheous key as Playmatch, so a third
proxy would silently share Playmatch's stored flag and be missing from
the switch list.

Both now hang off a Record keyed by HashMatcherKey, so adding a proxy to
the map fails to compile until it declares its own stored flag and its
name/logo/gate. providerKeysInGroup returns the narrowed union to make
that possible, and the catalog filter asks the taxonomy for the group
instead of matching against the proxy key list.

Payload wiring stays hand-written: which slot a matcher fills is set by
its backend gate, not by the taxonomy.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 18:44:57 -05:00
Sam Dornan
54f63e0544 refactor(v2): give the metadata provider taxonomy one home
The "general catalogs vs specialised sources vs hash proxies" split was
declared four separate times, each with its own shape: the scan
composable's key sets, and the provider arrays in the setup wizard's
metadata step, the settings view and the scan info dialog. Adding Steam
in #4241 filed it as specialised in three of them while the composable
treated it as general, and the fix took two passes because the first
sweep only found two of the three stragglers.

Provider slug to group now lives in one map, and each surface derives
its sections from it instead of declaring them, so the three near
identical markup blocks per surface collapse into one loop. Per-surface
presentation data (logos, locale keys, websites, docs URLs, heartbeat
wiring, section icons) stays where it is used. The hash matcher key
list and union are derived from the proxy group too.

Rendered providers, their order and their fields are unchanged; rows
and sections gained data-provider / data-group attributes as test
hooks.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 18:39:00 -05:00
Sam Dornan
3b9acc3e34 docs(hltb): state which scans resolve by stored ID
The docstring read as though a stored ID always wins, but the ID branch is
scoped to UPDATE and to UNMATCHED with no metadata. Say so, and cover the
COMPLETE fall-through with a test so the exclusion reads as deliberate.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 18:26:31 -05:00
nendo
97d2f7b5b7 perf(roms): trim per-page work on the roms list endpoint
Remove loader-option and query work the list endpoint discards:

- Batch the has_notes flag instead of eager-loading Rom.notes, whose
  backrefs to roms and users are both lazy="joined".
- noload RomUser.user everywhere rom_users feeds RomUserSchema, which
  carries no user fields.
- noload Rom.platform and Rom.metadatum in get_siblings_for_roms, where
  load_only narrows columns but not relationships.
- Let callers that resolve siblings themselves skip the sibling
  relationship load entirely.
- Eager-load RomFile.track_meta in get_files_for_roms, matching every
  other call site.
- Order the page over bare ids and fetch rows by primary key when the rom
  id index is off, instead of sorting the entity through a filesort.
- Derive the file-stat flags from the page's files when with_files is
  set, instead of running three correlated subqueries per row.
- Index rom_files on (rom_id, category).

Claude-Session: https://claude.ai/code/session_01J1pbRJBY3PatzkB5skQNEU
2026-08-22 08:19:18 +09:00
Sam Dornan
6932abc5a9 fix(hltb): keep a pinned HowLongToBeat match through a rescan
fetch_hltb_rom called the fuzzy filename search unconditionally, so an
UPDATE scan re-guessed the match even when rom.hltb_id was already set. Any
other game scoring above the similarity floor replaced an ID the user had
pinned by hand in Edit ROM.

get_rom_by_id has existed since #2926 was fixed, but only the Edit ROM path
called it. Extract resolve_hltb_rom as a module-level function, following
resolve_launchbox_rom, so the ID-first branch is covered by tests rather
than trapped in a closure over scan_rom's frame.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 18:06:07 -05:00
Sam Dornan
96311d7dac fix(frontend): treat a refused collection read as authoritative
A 404 or 403 on the per-collection read is the server saying the collection
is gone or off limits, so falling back to the cached copy kept a deleted
collection on screen (and a virtual one that a rescan took below the ROM
threshold that generates it). Those two statuses now drop the cached entry,
which is what makes the caller read not-found, while any other failure still
leaves the cached copy to fall back on.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 13:13:05 -05:00
Sam Dornan
a0ad833468 fix(frontend): make the collection refresh race- and failure-safe
Three holes in the refresh flow, from PR review:

A refresh asked for while a virtual-collection fetch was in flight hit the
in-flight guard and was dropped, so the pre-change response stayed cached
for the session. It is now queued behind the fetch and runs when it settles.

The refresh promise rejected on a failed request while both callers fire it
in the background, which surfaced as an unhandled rejection and a second
console error. It resolves empty instead, leaving the cached slice alone.

The per-navigation read gave the loader an await before it wrote the page
and drove the gallery, so a slow read could land after the route moved on
and show a collection nobody was looking at. Only the newest load may write
now, which also drops the duplicate gallery load the route guard and the
route watch used to cause between them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 13:10:10 -05:00
Sam Dornan
f4ac8a4e06 fix(frontend): keep collection ROM counts in step with the gallery
A collection's ROM count was rendered from the collections store, whose
lists are fetched once per session and never refreshed. Virtual collection
membership is derived from ROM metadata, so every scan and every metadata
match moves it with no collection write to update that copy from, leaving
a stale count in the head band next to a gallery that fetches live.

The collection page now re-reads the collection it is opening from the
server, falling back to the cached copy only when that request fails, and
the store re-reads its loaded virtual collections when a scan settles or a
metadata write lands, so the tiles and the open page follow along.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 13:00:35 -05:00
Sam Dornan
3819c8762d fix(gallery): rank region names by their shortcode's position
region_names_for_priority expanded the configured shortcodes into a flat
list of region names and _region_rank turned each name's index into its
rank. Two names claiming one shortcode ("nl" for both Holland and
Netherlands) therefore ranked unequally, so a Holland-tagged rom always
beat a Netherlands-tagged one instead of both falling through to the
filename tiebreak. The helper's own comment claimed otherwise.

It now returns name -> rank keyed on the shortcode's position, so aliases
tie. Unknown and repeated shortcodes still contribute nothing rather than
shifting the ranks after them, which is now covered by tests too.

Reported by Greptile and Copilot on #4260.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 12:11:56 -05:00
Sam Dornan
5c43a97687 feat(gallery): pick a game's default version by region priority
The group_by_meta_id dedup window ordered each sibling group by
is_main_sibling then fs_name_no_ext, so absent a manual override the
gallery entry went to whichever filename sorted first: "(Demo)" beat
"(Europe)" beat "(USA)".

Two ordering terms now sit between those: a full release outranks a
pre-release, then the configured scan.priority.region order decides.
Release status comes first because a demo is not a substitute for the
game, so a Japanese release wins over a USA demo.

scan.priority.region already existed but only steered metadata and
artwork selection, so its description is reworded across all locales.

Regions live in a JSON column that no covering index can carry, and 0107
measured what one uncovered reference costs this window: the plan drops
from `type=index, Using index` to `type=ALL, key=NULL`, four times per
gallery page load. 0108 adds a STORED generated column over regions[0]
and covers it in idx_roms_sibling_cover instead, so the ranking reads a
scalar. The engine keeps it in sync and ALTER TABLE populates existing
rows, so no scan hook and no backfill are needed.

Pre-release detection matches the filename rather than the parsed `tags`
column: tags keep the dumper's casing, and fs_name_no_ext is already in
the index.

Reordering the priority list changes which rom represents a group, so the
cached gallery sidecars are dropped when the setting changes.

Closes #1528

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 11:55:07 -05:00
Georges-Antoine Assi
01deed2d76 Merge pull request #4250 from rommapp/chore/review-polish-skill
chore(agents): add a review-polish skill from recurring PR corrections
2026-08-20 21:47:04 -04:00
Georges-Antoine Assi
76ff5c9b91 Merge pull request #4246 from Florian-Cullmann/agent/fix-invitation-registration-errors
Fix missing v2 auth notifications
2026-08-20 21:35:29 -04:00
Sam Dornan
e93eb879a2 chore(deps): bump starlette from 1.0.1 to 1.6.0
Drop the `exclude-newer-package` pin that froze starlette resolution at
1.0.1, and widen the version specifier to allow the 1.6.x line.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-20 09:00:58 -05:00
Sam Dornan
c77b6407c3 feat(v2): link server stats platform rows to their platform
Each row in Settings > Server Stats > Platforms now navigates to that
platform's gallery. Rows render as anchors so modifier-click opens a new
tab, and a plain click runs the same platform-icon morph the Platforms
index rows use. The regions expand toggle stops its click so expanding
regions never navigates.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-20 08:24:49 -05:00
Georges-Antoine Assi
4eb80a7e95 fix(v2): remember the core a game was launched with
The v2 player read `player:<rom_id>:core` and `player:<platform_slug>:core` at
mount but never wrote either, so picking a core applied for that session only
and was forgotten on reload. The v1 player writes both on launch, so v2 was
missing that half.

Arcade is where this bites: its core list starts with mame2003, and resolution
falls back to the first entry, so a library that only runs under mame2003_plus
had no way to make the switch stick.

Both directions now go through one module, so the read and the write cannot
drift apart on the key format.

Fixes #4248

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 09:11:37 -04:00
Georges-Antoine Assi
7b993439c0 fix(agents): resolve two contradictions in the new guidance
Layer 3 is ephemeral state, so telling agents to write it to localStorage
contradicted the layer it sits under. Per-entity device preferences are their
own thing: they persist per device like layer 1 but stay keyed by entity and
out of user.ui_settings, so they get their own paragraph.

Ordering: review-polish renames things and edits tests, so it has to run
before the stack checks rather than after trunk. State the order explicitly.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 08:07:39 -04:00
Georges-Antoine Assi
9b186dce4d chore(agents): add a review-polish skill from recurring PR corrections
Categorized the 54 commits pushed on top of contributor work across the 37
most recent approved PRs, and wrote the recurring patterns down.

The dominant one is comment and docstring trimming: 17 of the 54 commits do
nothing else, and CLAUDE.md already forbids it in three separate rules. The
new skill names the shapes that keep landing (change history, restatements of
the adjacent line, defences of an obvious choice, comparisons to the
alternative not taken) and carries the counter-rule too, since over-extracted
constants get trimmed the same way.

The stack-specific patterns go to the skills that already own them: alembic
numbering collisions and if_not_exists to backend-development, snapshot-before-
await and narrow watch sources to frontend-v2-patterns, the trunk fmt step and
its recurring hits to pre-pr-verification, en_US spelling to frontend-i18n.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 07:57:39 -04:00
Florian Cullmann
325cfe0e13 Fix auth notification rendering 2026-08-20 00:35:38 +02:00
Georges-Antoine Assi
42e8043372 Merge pull request #4245 from Florian-Cullmann/fix/4244-zone-identifier
Ignore Windows Zone.Identifier files
5.2.0
2026-08-19 17:39:44 -04:00
Florian Cullmann
c15d3e7385 Ignore Windows Zone.Identifier files 2026-08-19 22:04:43 +02:00
Georges-Antoine Assi
9e6337ec12 Merge pull request #4243 from rommapp/claude/ss-dev-credentials-banner
feat(metadata): warn when ScreenScraper dev credentials are missing
2026-08-19 15:32:04 -04:00
Georges-Antoine Assi
02139fad99 remove falst 2026-08-19 15:23:27 -04:00
Georges-Antoine Assi
eccfeb0b6e refactor(metadata): drop the docs link from the ScreenScraper warning
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-19 15:22:54 -04:00
Georges-Antoine Assi
807bea2b79 fix(metadata): only warn once a heartbeat has landed
The store's defaults report every source as off, so a backend that is
down or refusing the heartbeat used to render as a confirmed
ScreenScraper misconfiguration.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-19 15:12:09 -04:00
Georges-Antoine Assi
08bbc097d8 chore(test): silence vue/one-component-per-file in the stub mocks
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-19 15:09:07 -04:00
Georges-Antoine Assi
6a8d34bcad Merge pull request #4242 from sdornan/claude/fervent-noyce-aba3ea
test: fix flaky LaunchBox release date property test (DST fold)
2026-08-19 15:06:36 -04:00
Georges-Antoine Assi
24743b03d8 feat(metadata): warn when ScreenScraper dev credentials are missing
Developer credentials are injected at build time, so a build made
outside our CI (packaged from source, e.g. nixpkgs) has none and
ScreenScraper refuses every request whatever the user account is.

The heartbeat now reports whether they are set, and the v2 metadata
sources page shows a warning banner naming the two environment
variables to set.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-19 14:45:31 -04:00
Georges-Antoine Assi
5315499057 Merge pull request #4240 from darkpaul91/romm-getRoms-query-misses-grouped-game-entries-when-filter-doesnt-match-primary-version
fix(backend): make filters match against all grouped versions instead of only the main version of each game entry
2026-08-19 14:43:25 -04:00
Georges-Antoine Assi
edff89f913 Merge pull request #4239 from sdornan/claude/filename-underscores-scraping-513712
Match LaunchBox dumps that separate words with underscores
2026-08-19 14:43:15 -04:00
Georges-Antoine Assi
cd02cc5e68 Merge pull request #4235 from sdornan/claude/github-issue-2926-validation-4a3669
fix(hltb): fetch metadata when a HowLongToBeat ID is set by hand
2026-08-19 14:19:23 -04:00