Commit Graph

10664 Commits

Author SHA1 Message Date
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
Georges-Antoine Assi
191d1efeea Merge pull request #3810 from rommapp/posthog-code/nginx-tcp-upstream
fix(docker): proxy nginx to gunicorn over TCP instead of unix socket
2026-07-18 19:10:17 -04:00
Georges-Antoine Assi
168fb2f009 fix(docker): sync nginx upstream port with DEV_PORT
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>
2026-07-18 19:05:40 -04:00
Georges-Antoine Assi
e9b166219b Merge pull request #3802 from TowyTowy/fix/sony-serial-search-pos-arg
fix(metadata): search the whole filename for Sony serial codes
2026-07-18 18:39:49 -04:00
Georges-Antoine Assi
8a5cfca4bc Merge pull request #3813 from Spinnich/fix/rahasher-archive-extraction
fix(retroachievements): extract non-zip archives before RAHasher hashing
2026-07-18 18:31:14 -04:00
Spinnich
e6c1ca8487 fix(archives): address extraction review findings from PR #3813
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>
2026-07-18 20:34:44 +00:00
Spinnich
e24b40a4eb docs(archives): correct RAR support claim in read_rar_archive_files
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>
2026-07-18 20:11:21 +00:00
Spinnich
b7c60e63a3 fix(retroachievements): extract non-zip archives before RAHasher hashing
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>
2026-07-18 20:06:12 +00:00
Georges-Antoine Assi
f4771ab398 Merge pull request #3804 from Spinnich/fix/m3u-folder-retroachievements-hashing
fix(retroachievements): resolve m3u playlists to natively hashed discs
2026-07-18 14:48:17 -04:00
Georges-Antoine Assi
0ca1eb5529 fix(docker): proxy nginx to gunicorn over TCP instead of unix socket
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
2026-07-18 14:44:08 -04:00
Spinnich
9eb9ceb1e0 test(retroachievements): cover rvz folders without a playlist descriptor
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>
2026-07-18 16:22:36 +00:00
Spinnich
91d0ad289f fix(retroachievements): resolve m3u playlists to natively hashed discs
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>
2026-07-18 12:53:14 +00:00
TowyTowy
ae6e6adbe2 fix(metadata): search the whole filename for Sony serial codes
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>
2026-07-18 12:11:29 +02:00
Georges-Antoine Assi
97d9289c39 Merge pull request #3790 from rommapp/posthog-code/soundtrack-filter
feat: add soundtrack gallery filter
2026-07-17 10:58:29 -04:00
Georges-Antoine Assi
0dc670ce8c fix: reload gallery for soundtrack filters
Generated-By: PostHog Code
Task-Id: 97eb615e-7d63-4b79-a9d3-8d86c2f93866
2026-07-17 09:48:04 -04:00
Georges-Antoine Assi
845a6c321e fix: localize soundtrack filters
Generated-By: PostHog Code
Task-Id: 97eb615e-7d63-4b79-a9d3-8d86c2f93866
2026-07-17 09:41:01 -04:00
Georges-Antoine Assi
45d1d75511 Merge pull request #3791 from rommapp/posthog-code/fix-igdb-region-priority
fix: respect configured IGDB region priority
2026-07-17 09:25:47 -04:00
Georges-Antoine Assi
4113461067 test: correct IGDB locale priority expectation
Generated-By: PostHog Code
Task-Id: 6764d95b-659d-4e11-a5c5-28e65431d944
2026-07-17 09:19:18 -04:00
Georges-Antoine Assi
04c95c8ad6 fix: normalize IGDB region priority matching
Generated-By: PostHog Code
Task-Id: 6764d95b-659d-4e11-a5c5-28e65431d944
2026-07-17 09:09:15 -04:00
Georges-Antoine Assi
73874e8d7b feat: add soundtrack gallery filter
Generated-By: PostHog Code
Task-Id: 97eb615e-7d63-4b79-a9d3-8d86c2f93866
2026-07-17 08:52:14 -04:00
Georges-Antoine Assi
070851d2d8 fix: respect configured IGDB region priority
Generated-By: PostHog Code
Task-Id: 6764d95b-659d-4e11-a5c5-28e65431d944
2026-07-17 08:52:11 -04:00
Georges-Antoine Assi
04c000ef7b Merge pull request #3789 from rommapp/posthog-code/v2-gallery-per-card-fetch
revert(v2): hydrate gallery cards per-card via /roms/{id}/simple
2026-07-17 08:08:42 -04:00
Georges-Antoine Assi
69c44d9ab1 fix(v2): guard per-card fetch cleanup by controller identity
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
2026-07-17 07:50:40 -04:00
Georges-Antoine Assi
5790ff0d95 fix(v2): refetch list rows on gallery context refresh
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
2026-07-17 07:48:05 -04:00
Georges-Antoine Assi
560a75f991 revert(v2): hydrate gallery cards per-card via /roms/{id}/simple
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
2026-07-17 07:40:22 -04:00
Georges-Antoine Assi
68c0f4c18a Merge pull request #3785 from TowyTowy/fix/supported-platforms-tgdb-id
fix(platforms): include TGDB handler in tgdb_id fallback for supported platforms
2026-07-16 21:37:28 -04:00
Georges-Antoine Assi
d760b8d13e Merge pull request #3781 from rommapp/posthog-code/roms-optional-id-index
perf(roms): make full rom id index opt-out on GET /api/roms
2026-07-16 21:20:19 -04:00
Georges-Antoine Assi
bc602972c7 cleanup 2026-07-16 21:00:57 -04:00
Georges-Antoine Assi
6ca8d943b2 Merge branch 'master' into posthog-code/roms-optional-id-index 2026-07-16 20:58:46 -04:00
Georges-Antoine Assi
07bf93508b Merge pull request #3780 from rommapp/posthog-code/roms-platform-fs-size-index
perf(backend): index roms (platform_id, fs_size_bytes)
2026-07-16 20:57:57 -04:00
Georges-Antoine Assi
3db9cde084 cleanup 2026-07-16 20:39:54 -04:00
Georges-Antoine Assi
a171aa97bc Merge pull request #3779 from rommapp/posthog-code/fix-simple-rom-eager-load
fix(backend): lightweight eager-load for /roms/{id}/simple
2026-07-16 20:37:45 -04:00
Georges-Antoine Assi
f771f1173b Merge pull request #3778 from rommapp/posthog-code/fix-ss-invalid-json-escape
fix(ss): tolerate ScreenScraper's invalid JSON escapes
2026-07-16 20:30:38 -04:00
Georges-Antoine Assi
0cf5f472a5 Apply suggestion from @greptile-apps[bot]
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-07-16 19:07:26 -04:00
Georges-Antoine Assi
484b1d3958 Merge pull request #3765 from rommapp/posthog-code/fix-v2-gallery-batch-fetch
fix(v2): batch gallery cover fetches into windows
2026-07-16 19:06:00 -04:00
TowyTowy
f225a99f89 fix(platforms): include TGDB handler in tgdb_id fallback for supported platforms
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>
2026-07-17 01:04:45 +02:00
Georges-Antoine Assi
8c236a982b upgrade trunk 2026-07-16 19:01:59 -04:00
Georges-Antoine Assi
3dd9c69687 cleanup comment spam 2026-07-16 19:00:42 -04:00
Georges-Antoine Assi
d4018e5d3a fix(v2): skip metadata aggregations on later gallery windows
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
2026-07-16 18:55:24 -04:00
Georges-Antoine Assi
04ae566749 Merge pull request #3783 from rommapp/posthog-code/v2-hasheous-provider-link
feat(v2): link Hasheous provider to game detail page
2026-07-16 18:49:44 -04:00
Georges-Antoine Assi
c3721a8a69 Merge pull request #3782 from rommapp/posthog-code/v2-igdb-provider-link
fix(v2): link IGDB provider to game page by slug
2026-07-16 18:49:05 -04:00
Georges-Antoine Assi
ab01cd0e24 feat(v2): link Hasheous provider to game detail page
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
2026-07-16 18:41:06 -04:00
Georges-Antoine Assi
6a9236aada fix(v2): link IGDB provider to game page by slug
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
2026-07-16 18:40:44 -04:00