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>
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>
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>
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>
The nginx upstream was hardcoded to 127.0.0.1:5000, while gunicorn and the
readiness check bind/probe ${DEV_PORT}. With a non-default DEV_PORT the
readiness check passes but every proxied request returns 502.
nginx.conf is not run through envsubst, so move the wsgi_server upstream into
the templated default.conf.template and export DEV_PORT in the entrypoint so
the upstream port tracks the gunicorn bind.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Disable 7zz wildcard matching (-spd) when extracting a named member: a
member literally named with "*" or "?" would otherwise act as a pattern,
matching other members and concatenating them into the -so stream, which
would hash plausible-but-wrong data. Applied to all three extraction
call sites, including the two pre-existing readers that share the
hazard. Verified against the production Alpine 7zz build.
Route extraction stderr to an unlinked temp file instead of a pipe: a
filled pipe blocks 7zz while the parent waits on stdout.read(), which
the chunk-based deadline never interrupts. A file-backed stderr applies
no backpressure and is still read back for the error log on failure.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The bundled Alpine 7zz build lacks the RAR codec: listing RAR members
works, but streaming their contents fails with "Unsupported Method"
(verified against the production image).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
RAHasher only decompresses .zip archives itself; any other container
(.7z, .rar, .gz, .bz2, .xz, .tar, ...) was hashed as its raw archive
bytes, silently storing a well-formed hash that matches nothing on
RetroAchievements (issue #3808).
Non-zip archives on buffer-hash platforms are now extracted to a temp
file via the bundled 7zz binary and the extracted ROM is hashed instead.
The new extract_largest_archive_member helper follows the existing 7zz
subprocess patterns, handles single-stream formats whose listings carry
no Attributes line (.gz/.xz), and unwraps one level of nesting so
compressed tarballs (.tgz) reach the ROM inside the inner tar.
Arcade is exempt: its RA hash is computed from the file's basename, so
any container format already hashes correctly and extraction (which
renames the file) would break it. Disc platforms keep their existing
archive skip.
When extraction fails (corrupt archive, or a codec the 7zz build lacks,
e.g. RAR) no hash is stored at all and the 7zz stderr reason is logged
at error level, so scan logs explain the missing hash instead of
silently storing a garbage one.
Fixes#3808
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
nginx workers are dropped to the `romm` user while gunicorn creates
/tmp/gunicorn.sock as root. This only worked because gunicorn's default
umask leaves the socket world-writable; on some hosts (e.g. OMV) the
worker cannot connect() and every /api request 502s with
"connect() to unix:/tmp/gunicorn.sock failed (13: Permission denied)".
Proxy over loopback TCP (127.0.0.1:5000), which gunicorn already binds,
so there is no socket file owner/mode to mismatch. Readiness now polls
the TCP port instead of waiting for the socket file.
Fixes#3809
Generated-By: PostHog Code
Task-Id: 3cb72cda-eb77-4bc0-97ab-cde365a031c9
A disc folder holding only .rvz files (no .cue/.gdi/.m3u) resolves via the
largest-file fallback in _pick_ra_file; assert that the picked disc reaches
the native GameCube/Wii hasher instead of RAHasher.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Folder-based multi-disc ROMs resolve their /* glob to the .m3u playlist,
but RAHasher can only follow a playlist to formats it can read. When the
first playlist entry is a container we hash natively (RVZ/WIA on
GameCube/Wii, compressed ISO on PSP), resolve the playlist to that disc
so the native-hash dispatch sees it.
Fixes#3797
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pattern.search() takes pos as its second argument, not flags, so passing
re.IGNORECASE (value 2) started the serial scan at index 2. Filenames
that begin with the serial itself (e.g. SCUS-94163.bin) never matched,
and the PS1/PS2/PSP serial index resolution was silently skipped in the
IGDB, MobyGames, and ScreenScraper handlers.
The regex already matches both cases via [a-zA-Z], and the serial is
uppercased before the Redis lookup (#3621), so the intended flag added
nothing. Drop the stray argument so serials are found anywhere in the
filename, including at the start.
Co-Authored-By: Claude <noreply@anthropic.com>
An aborted per-card fetch's finally deleted the inFlightControllers entry
unconditionally. If the position was cancelled and quickly re-entered the
viewport, a replacement request could store a new controller under the
same rom:${position} key before the aborted request reached finally; the
unconditional delete then removed the new controller, so its response
failed the ownership check and the card stayed a skeleton.
Compare controller identity in both the success re-check and the finally
delete (mirroring fetchInitialMetadata) so a request only ever clears its
own entry.
Generated-By: PostHog Code
Task-Id: fe232494-3d20-4d83-9eaa-3ce341d4e7b5
A list row fetched its rom only in onMounted. A filter / search / sort /
scan refresh clears byPosition and repopulates romIdIndex while the row
stays mounted at the same position, so it was stranded on skeletons until
it scrolled out and remounted.
Replace the onMounted fetch with a watch that fires fetchRomAt whenever
the position is missing its rom but the store knows its id. Guarding on
the id (not just a null rom) also refetches when a resort lands a
different rom at the same position. The store still dedupes against
in-flight + already-loaded, so re-runs are cheap.
Generated-By: PostHog Code
Task-Id: fe232494-3d20-4d83-9eaa-3ce341d4e7b5
The v2 gallery had been switched from per-card GET /roms/{id}/simple
hydration to batched window fetches because the /simple endpoint was
slow. Now that /simple is fast (lightweight eager-load), revert the
gallery back to per-card hydration: onMount fetches a single rom by id
and onUnmount aborts if the card scrolled out of view.
Reintroduces fetchRomAt / cancelFetchAt and drops the now-unreachable
window-fetch machinery (fetchWindowAt, syncVisibleWindows, the window
auto-retry, and the batched-apply helpers). Keeps the later
improvements: the withCharIndex / withFilterValues skip params on the
roms API and the abortInFlight store action.
Generated-By: PostHog Code
Task-Id: fe232494-3d20-4d83-9eaa-3ce341d4e7b5
get_supported_platforms() resolved tgdb_id from the MobyGames and
Hasheous platform entries only, but MobyGames platforms never carry a
tgdb_id and the Hasheous platform list has no TGDB mappings, so the
explicit key always overrode the value spread from the TGDB handler
with None. Mirror the fallback chain used during scans in
scan_handler.py by falling back to the TGDB platform entry itself.
Co-Authored-By: Claude <noreply@anthropic.com>
Once the bootstrap or window 0 has populated the filter panel, alpha
strip, and id index, later window fetches only need their paged items.
Send with_char_index=false and with_filter_values=false so the backend
doesn't recompute those aggregations for every window.
Generated-By: PostHog Code
Task-Id: daf23950-b84a-4537-971c-3f85425c172c
Add a URL builder for the Hasheous provider so its card in the
GameDetails provider grid links out to the corresponding game page
instead of rendering unlinked.
Generated-By: PostHog Code
Task-Id: 522c9198-de9b-4973-9057-ce4c0a33dcc9
The IGDB provider link built a text-search URL from the numeric ID,
which returns no results. Point it at the canonical /games/<slug> page
when the slug is present, falling back to the ID search otherwise. The
URL builder now receives the DetailedRom so it can reach fields beyond
the provider ID.
Generated-By: PostHog Code
Task-Id: 6843b623-ed80-454f-8373-8192f3c629b4