Commit Graph

4657 Commits

Author SHA1 Message Date
Georges-Antoine Assi
7e5a3492eb Merge pull request #4142 from sdornan/claude/scan-page-missing-active-display-30873c
fix(v2): show a running scan on pages loaded mid-scan
2026-08-08 09:40:25 -04:00
Georges-Antoine Assi
23d0042ffb refactor(v2): narrow the scan reconcile watch source
Watching the eligible user's id instead of the whole user object lets
Vue dedupe the reconcile, so the manual once-per-login flag goes away.
Move the remaining in-flight guard next to the code that reads it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 19:27:05 -04:00
Georges-Antoine Assi
0f9d2fc53b Merge pull request #4139 from sdornan/claude/github-issue-4127-dd46eb
fix(ss): store the ScreenScraper box-2D front locally
2026-08-07 18:59:15 -04:00
Georges-Antoine Assi
ba6e63e408 Merge pull request #4138 from Spinnich/fix/random-pick-non-gallery-route
fix(v2): drop a random pick that lands after leaving the gallery
2026-08-07 18:50:57 -04:00
Georges-Antoine Assi
3e97df0db8 docs(v2): trim the useIsAlive header comment
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 18:46:16 -04:00
Georges-Antoine Assi
3eb199363d refactor(v2): extract the alive-scope guard into useIsAlive
Collection.vue and Platform.vue each carried an identical manual
`unmounted` flag to keep a late random pick from navigating a component
that had already gone away. Replace both with a shared composable built
on `onScopeDispose`, so the guard also works outside a component.

VueUse's `useMounted` is not a substitute: it only flips to `true` on
mount and never back to `false` on teardown.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 18:41:07 -04:00
Georges-Antoine Assi
704b0b23fb Merge pull request #4136 from Spinnich/feat/platforms-search-fields
feat(v2): search platforms by slug, folder, category and family
2026-08-07 16:06:04 -04:00
Georges-Antoine Assi
04b2974ddc Update frontend/src/v2/views/PlatformsIndex.vue 2026-08-07 15:52:32 -04:00
Georges-Antoine Assi
a5854b557e Merge pull request #4121 from sdornan/claude/launchbox-n64-matching-b7ce16
fix(launchbox): match ROMs during a scan the way Match ROM does
2026-08-07 11:24:23 -04:00
Georges-Antoine Assi
4b574ee284 refactor: share one article list across sort and launchbox matching
The sort key and the launchbox inverted-title matcher each carried their
own copy of the same 16 articles. Build both patterns from a single
ARTICLES tuple, and point the frontend's hand-synced copy at it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 08:42:14 -04:00
Sam Dornan
2122875d9c test(v2): cover the deferred-auth reconcile path
Addresses review feedback on #4142.

`authStore.user` is null at install in the real flow, since AppLayout
mounts while /users/me is still in flight, and the watch is what catches
the arrival. That path had no coverage, and couldn't have: the auth mock
was a plain object, so the watch never fired on change. Making it
reactive exposed a second problem, that the host component was never
unmounted, leaving earlier tests' watchers alive to reconcile again on
the shared state. Unmount in afterEach.

Also swap the double-nextTick settle for an explicit flushPromises, and
optional-chain `running.meta` since the task status is a JSON boundary
where a missing snapshot should mean "no counters yet", not a throw.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-06 15:48:10 -05:00
Sam Dornan
9c339336a9 fix(v2): show a running scan on pages loaded mid-scan
Scan state was built up purely from socket events, so a tab that loaded
while a scan was running started at `scanning: false`: /scan rendered its
empty state with an armed Start button and the navbar pill stayed hidden.

Two changes:

`scan:update_stats` now flips `scanning` on. It is the only event a scan
emits continuously, since `scanning_platform` fires once per platform and
`scanning_rom` only for ROMs the scan actually adds, so an update scan
over a settled library emits nothing else for long stretches.

`reconcileWithRunningScan` asks /api/tasks/status on install and seeds
`scanning` plus `scanStats` from the running job's meta, so a refresh or
a second tab is correct immediately rather than eventually. Gated on the
`tasks.run` scope, the same one the scan socket handler requires. Guards
cover a terminal event landing mid-request and live stats being fresher
than the job snapshot.

The per-platform live log is unchanged: it only ever exists in the
originating tab's memory, so it fills in from the next platform onward.

Fixes #4141

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-06 15:24:39 -05:00
Sam Dornan
d758c8f472 fix(ss): store the box-2D front locally so it survives cover priority
ScreenScraper's box-2D was the only media type that never got a local
file: it fed url_cover and nothing else. When any other provider won the
cover (the default, since SCAN_ARTWORK_PRIORITY puts ss fourth), the box
front was recorded as a URL and never downloaded, leaving it unreachable
from the UI. Enabling box2d_back/box2d_side could only be made to look
right by forcing ss to the top of scan.priority.cover.

box-2D now records a box2d_path when box2d is listed in scan.media, like
every sibling media type. The Artwork subtab lists the box front, and
the interactive 3D box takes its front face from that scan (falling back
to the rom cover), so all three faces come from the same source and the
3D box no longer depends on cover priority.

Fixes #4127

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-06 12:38:35 -05:00
Spinnich
237a16a54a fix(v2): drop a random pick that lands after leaving the gallery
The staleness check added in #4113 asks whether a different gallery is
loaded, not whether the user is still in the gallery they clicked from.
Leaving for a non-gallery route never runs `resetGallery()` and never
clears `Collection.vue`'s local `currentCollection` ref, so the captured
scope id still matches: the pick navigates away from wherever the user
went, and a failed pick toasts on that unrelated page.

Treat the view being torn down as stale and OR that into the existing
`stale()` closure, so both symptoms go through the same gate. This also
covers hopping between collection kinds, which are separate route
records whose local ref the id check could never see go stale.

Fixes #4114

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-06 16:35:08 +00:00
Georges-Antoine Assi
9a18aca025 Merge pull request #4135 from sdornan/claude/safari-image-rendering-b90a15
fix(v2): compute game-card cover width instead of deriving it
2026-08-06 09:50:06 -04:00
Spinnich
9e9cefac6e feat(v2): search platforms by slug, folder, category and family
The platforms index only matched the display name, so a platform you
know by its folder on disk, its slug, or its family stayed unreachable
unless you guessed the name RomM shows.

Match the term against the display name, slug, fs_slug, category and
family name. Category contributes both the raw stored value and the
prettified label, since the label is what the list column and the group
heading show while the raw value is what the app stores.

The placeholder now names the searchable fields, in the same style the
ROM search uses.
2026-08-06 12:48:00 +00:00
Sam Dornan
e9fe52a108 fix(v2): compute game-card cover width instead of deriving it
Non-hero GameCards render at a fixed height with a natural width, which
`.r-gc__art` took from GameCover's `aspect-ratio` via `width: auto`. That
makes the width depend on the aspect-ratio transferred size, and inside a
shrink-to-fit ancestor (the Match ROM dialog's grid cell) the resolution is
circular. WebKit collapses it to a few pixels, so covers render as thin
slivers of the image.

Multiply the height by the cover ratio instead. Both are already CSS
variables on the element, so the width lands on the same number with
nothing left for the engine to resolve.

44ef5cf5 addressed the same report by making the cell a flex container.
That changed where the width was resolved but left the transfer in place,
so the covers still collapsed on 5.1.0.

Fixes #3761

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 21:39:06 -05:00
Georges-Antoine Assi
234c5b3ea2 Merge pull request #4120 from sdornan/claude/romm-playmatch-disabled-bug-60843f
fix(v2): keep Playmatch selectable when providers are set to All
2026-08-05 21:34:47 -04:00
Georges-Antoine Assi
b0b07c4f85 Merge pull request #4096 from wadiebs/feat/v2-header-provider-ratings
feat(Rating): show provider ratings
2026-08-05 20:36:04 -04:00
Georges-Antoine Assi
d64c6d7ec5 cleanup 2026-08-05 20:31:01 -04:00
Georges-Antoine Assi
78c3b4b588 fix(v2): restore MobyGames 0-10 score scaling
The MobyGames API returns moby_score on a 0-10 scale and the backend
stores it verbatim (handler/metadata/moby_handler.py), so a score of 5.5
was rendering as "5.5%" instead of "55%". v1 applies the same multiplier
in Details/Title.vue, as does the mock library generator.

This reverses 781e4ff0f, whose premise that the backend already returns
0-100 scores is not borne out by the recorded API responses in the
MobyGames cassettes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 20:25:39 -04:00
Georges-Antoine Assi
6f8b509b71 refactor(v2): show provider ratings on metadata source cards
Ratings had their own section in the metadata tab, duplicating the
provider list rendered right below it. Each score now sits on its
provider card, right aligned next to the external ID, and the standalone
section is gone.

Scale normalization and percent formatting move into providerRating(),
next to providerId(), so the provider registry stays the single source
of truth. Formatting itself is now Number.toLocaleString with
style: "percent" rather than toFixed plus manual trailing-zero
stripping, which also drops the NaN chips that missing metadata used to
render.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 20:25:29 -04:00
Sam Dornan
198f471e75 docs: drop em-dashes from the scan-provider comments
Repo style forbids em-dashes in comments and text. Also trims the
provider-categorisation comment, whose parentheticals just enumerated the
two lists below it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 19:16:17 -05:00
wadie
781e4ff0f2 fix(v2): remove MobyGames score overscaling in ratings
MobyGames backend already provides 0-100 scores. Remove the unnecessary
multiplication by 10 that was causing scores like 90 to display as 900%.
2026-08-05 16:15:00 +02:00
wadie
103395f0cd refactor(v2): move provider ratings from header to metadata tab
- Remove ratings display from GameHeader component
- Move rating logic (formatRating, normalizeToTen, RatingChip type) to MetadataTab
- Add new 'Ratings' section in metadata tab (between Verification and Provider links)
- Display ratings with provider logos (16×16px) and formatted values
- Add 'ratings-label' translation key to all 18 locale files
- Improve organization: ratings now grouped with provider metadata instead of header
2026-08-05 14:17:31 +02:00
Sam Dornan
60ac4ca4f5 refactor(v2): drop the dead IGDB label rename
`getAllMetadataOptions()` stopped labelling IGDB as "IGDB + Playmatch" in
aed926ac9, when Playmatch became its own metadata source. The rename that
stripped the suffix stayed behind, and the test fixture asserted the old
label, so the fixture only passed because the rename normalised it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 06:59:44 -05:00
Sam Dornan
5f91eaf91a fix(v2): keep Playmatch selectable when providers are set to All
The provider selects represent "All" as an empty model, so the Playmatch
gate read no IGDB and forced the switch off. It also meant an All-mode
group sent an empty `apis` list, which the backend reads as "no sources".

Both scan dialogs now expand All-mode groups before gating Playmatch and
building the payload, matching what the Scan view already did.

The three surfaces had drifted apart because they each carried their own
copy of this logic, so it moves to a shared `useScanProviders` composable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 21:39:26 -05:00
Spinnich
ccf3582b1a fix(v2): mirror the stale pick failure guard in the collection gallery
The collection gallery carried the same unconditional error handler, so a
request that rejected after the user switched collections raised a snackbar
for the one they left.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 23:09:36 +00:00
Spinnich
65db3a0c2d fix(v2): keep a stale random pick failure quiet
A request that rejects after the user switched platforms reached the
unconditional error handler, so an abandoned platform could still raise a
snackbar. Gate it on the same staleness check the success path uses.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 23:09:36 +00:00
Spinnich
b4519eda71 fix(v2): drop a random pick after leaving the platform
The platform gallery's Random ROM button never re-checked which platform
was on screen when its request came back, so a pick started before
switching platforms still navigated, landing the user in a game from the
gallery they had left. Capture the platform id at click time and abandon
the pick once it no longer matches, the same guard the collection gallery
already carries.

Fixes #4104

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 23:07:16 +00:00
Georges-Antoine Assi
5f61452865 Merge pull request #4110 from Spinnich/fix/home-rows-skip-total
perf(home): stop counting the whole library for the two home rows
2026-08-04 17:57:03 -04:00
Spinnich
dbd213c6c9 perf(home): stop counting the whole library for the two home rows
The "Recently added" and "Recently played" rows each ask for 15 games and
render 15 covers, but both requests still made the server count every game
in the library and then discarded the number. On a large library that count
is the expensive part of the request, so opening the home page paid for two
whole-library counts nobody sees.

Both rows now send with_total=false, the option added for the gallery in
#4062.

The flag has to reach the request and the cache-clear pattern together: the
pattern is matched against the cache key by substring, so adding it to only
one side would leave the row permanently stale. The cached service now
builds both from a single parameter map per row so they cannot drift, and
the tests assert the clear pattern still matches the key the request writes.

Fixes #4099

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 17:20:23 +00:00
Spinnich
5521b851b8 perf(gallery): resolve the random rom button in one request
The platform and collection "Random ROM" buttons asked the API for the
scope total, then for the single row at a random offset, and neither call
opted out of the char index, the filter values or the rom id index. All
three cover the whole result set, so picking one game did about as much
work as loading the entire gallery. Scoped requests are never cached
either, so the full cost came back on every click: on an 83,000-game
instance, 7.19s and 878KB against 0.27s and 16.9KB for the same request
with the sidecars off.

Both buttons now call GET /api/roms/random, which samples on the primary
key and returns one row. The scope parameters it already accepts cover
the platform id and all three collection kinds, so the collection view
keeps its kind split unchanged and null stands in for an empty scope.

The v1 RandomBtn / ContextualRandomBtn share the old shape and are left
alone, since v1 is frozen.

Fixes #4068

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 13:21:54 +00:00
wadie
f601e210d2 feat(v2): show provider ratings in game details header 2026-08-04 14:33:12 +02:00
Georges-Antoine Assi
d874cc1738 Merge pull request #4071 from Spinnich/fix/random-pick-constant-time
perf(roms): pick a random rom without paging to a random offset
2026-08-04 08:25:07 -04:00
Georges-Antoine Assi
042a36240f Merge pull request #4069 from Spinnich/fix/home-setup-library-scan
fix(home): stop scanning the library filesystem on every home page load
2026-08-04 08:24:39 -04:00
Spinnich
b6d43ce73c chore(roms): drop the comment on the random rom api wrapper
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 11:24:06 +00:00
Spinnich
c8ab8dda9d fix(v2): order the ROM metadata hashes like the rest of the UI
The files list and the firmware list both read SHA-1, CHD SHA-1, MD5, CRC,
RA. The metadata tab led with CRC instead, so the same hashes appeared in a
different order depending on which tab the user was on.

Covers the ordering with a unit test, including the CHD SHA-1 position: the
mock library holds no CHD, so that branch cannot be reached in a browser.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-03 16:15:35 +00:00
Spinnich
959e5c0db9 fix(v2): label the ROM metadata hash row SHA-1 to match every other surface
MetadataTab was the only place labelling the row SHA1, while FileRow,
FilesSummary and the firmware list all use SHA-1. It was also inconsistent
within its own list, sitting directly beside a CHD SHA-1 row.

The label is hardcoded rather than translated, so no locale changes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-03 16:05:55 +00:00
Spinnich
f815c77ca0 fix(v2): make hashes recoverable without HTTPS and show all firmware hashes
The Clipboard API only exists in a secure context, so over plain HTTP the
copy button on a hash chip always failed. Because the displayed value is
abbreviated in JavaScript, the rest of the hash was never in the DOM
either, leaving the full value unreachable on any HTTP install.

Clicking a chip now reveals the full value as selectable text whenever a
copy cannot land, so Ctrl+C works as a fallback. On HTTP the click no
longer attempts the doomed copy, so the misleading error toast is gone.
Behaviour over HTTPS is unchanged apart from revealing when a copy throws.

The firmware tab only ever showed the MD5, as an unselectable chip with no
copy affordance, while the stored CRC and SHA-1 were never displayed. All
three now render as copyable chips, matching the ROM files tab.

Fixes #4082

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-03 15:35:41 +00:00
Spinnich
1ee6cea070 perf(roms): pick a random rom without paging to a random offset
The Home "Random Pick" widget asked the API for the library total, then
for the single row at a random offset. Paging to offset N makes the
database walk and discard the N rows before it, so the pick got slower
the bigger the library: measured on an 83,000-game instance, 1.7s at the
median offset and 6.9s deep into the list, on every home page visit.

Adds GET /api/roms/random. It offers the query a batch of random primary
keys and takes any that exist, which is one index lookup per candidate
and unbiased, since every id in the table is equally likely to be
offered. A batch only misses when the query matches too little of the id
space, and it then falls back to counting the set and taking the row at a
random position, reading index entries rather than rows because the
statement selects nothing but the id. Both paths are uniform.

On the same 83,000-game library: 2.9ms median for an unscoped pick
(0.6% of picks take the fallback, 236ms), 19-25ms scoped to a platform.
The widget now resolves a pick in one request.

The endpoint takes the platform / collection scope parameters so the
gallery "Random ROM" buttons (#4068) can move onto it too.

Fixes #4066

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-02 19:25:36 +00:00
Spinnich
e85f2fe4ef fix(home): stop scanning the library filesystem on every home page load
The v2 home page requested GET /api/setup/library on every visit, which
walks every platform directory under the library path to count files.
That hint only exists for brand-new instances, but it fired for everyone:
17s per home page load on an 83k-game library, 38s on slower storage, and
the result was thrown away because the library wasn't empty.

The frontend watcher was wired to `isEmpty` with `immediate: true`, so it
ran during setup, before any of the page's data requests had started. All
the `fetching*` flags were still false and the stores were still empty, so
the library looked empty and the walk kicked off.

Frontend: onMounted now awaits the initial fetches and flips an
`initialLoadDone` flag. The watcher and the empty-state `v-if` both gate on
`initialLoadDone && isEmpty`, so the request and the render can no longer
disagree about whether the library is empty.

Backend: get_setup_library_info() returns early with an empty
`existing_platforms` once the database holds ROMs, since the on-disk hint is
meaningless then. Gated on ROMs alone, not platforms: platform rows with
zero ROMs are exactly the case the hint exists for, so those still walk.

Fixes #4063

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-02 16:34:15 +00:00
Georges-Antoine Assi
361b2414d3 fix(stats): pluralize the platform game count and lift meta legibility
Server Stats rendered "1 games" for a single-game platform, and the row
meta line leaned on the faint foreground tier: the middot separator, the
size percentage and the region expand toggle all sat at the edge of
readability.

- Pass the count as vue-i18n's plural choice and give every locale the
  plural forms its `collection.games-count` sibling already uses.
- Draw the separator as a 4px dot in the muted tier instead of a thin
  middot glyph, and move the size percentage off the faint tier.
- Outline the region expand/collapse control so it reads as a button,
  and label it for screen readers.
- Spell out the coverage tooltip as "IGDB matches: 159 / 227".

Fixes #4057

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-02 12:18:53 -04:00
Georges-Antoine Assi
4fac604e65 Merge pull request #4062 from Spinnich/fix/gallery-window-skip-total
perf(roms): let a gallery window fetch skip the library count
2026-08-02 11:00:51 -04:00
Georges-Antoine Assi
1e514ec273 chore(roms): drop redundant comments on the total opt-out
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 20:27:57 -04:00
Georges-Antoine Assi
43cdd0856a refactor(roms): resolve the page total in a helper
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 19:59:29 -04:00
Georges-Antoine Assi
79a8322470 Merge pull request #4060 from rommapp/fix/hasheous-mameredump-verified
fix(hasheous): read the CHD and DOS signature sources
2026-08-01 19:48:56 -04:00
Spinnich
0be6e3a70f perf(roms): let a gallery window fetch skip the library count
Opting out of the rom id index made the endpoint fall back to a COUNT
over the whole filtered set, so every scroll batch re-derived a total
the page already had from its bootstrap.

Add a with_total flag that skips that count, and have the v2 gallery's
window fetch pass it alongside the sidecar opt-outs it already sends.
total comes back null there, which the store's existing guard leaves
alone rather than applying over the size it knows.

Fixes #4053

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-01 23:00:38 +00:00
Georges-Antoine Assi
56f8a51e04 fix(hasheous): read the CHD and DOS signature sources
The match flags on `hasheous_metadata` are keyed off Hasheous'
`SignatureSourceType` names, and two never lined up with what its API
actually returns:

* `MAMERedump`, the source holding Redump's disc images in CHD form, was
  mapped to nothing at all. A CHD identified by its disc-data SHA1 matched,
  got its metadata, and still read as unverified because no flag was set.
* `puredos_match` looked for `PureDOS`; the source is named `PureDOSDAT`, so
  the flag was pinned to False for every ROM.

CHD matches now set `mame_redump_match`, which the verified filter counts and
which the Metadata tab folds into the existing Redump chip (same database,
different distribution format). Existing rows pick the flag up on their next
rescan.

Hasheous also exposes Pleasuredome, TotalDOSCollection, eXo, ScreenScraper and
Generic sources that RomM still maps to nothing; those are left alone since
folding them in widens what "verified" means.

Fixes #4030

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 18:10:16 -04:00
Georges-Antoine Assi
2bdd1956fc Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-08-01 17:58:43 -04:00