Commit Graph

17 Commits

Author SHA1 Message Date
Sam Dornan
d975aa8bc3 fix: restore HowLongToBeat lookups and repair endpoint discovery
HLTB lookups have returned nothing since HLTB rotated their search endpoint.
The published fixture still pointed at /api/bleed, which now 404s on both GET
and POST, and the handler fetches that fixture from master at every startup, so
every install was affected regardless of image version. The live endpoint is
/api/search/site, with the session mint at /api/search/site/init, which the
handler already derives as f"{search_url}/init".

The automation meant to keep the fixture current could not have fixed this on
its own. It only ran on workflow_dispatch, so it never ran unprompted, and HLTB
has since migrated to Turbopack: the homepage no longer serves a pages-router
_app chunk, so both app-chunk regexes matched nothing. The endpoint is also a
plain literal in the bundle now rather than the .concat() obfuscation the token
regex expected.

Discovery now reads _buildManifest.js, where Next.js lists every route as a
plain literal, and selects the route that has an /init sibling, the same pairing
HLTBHandler assumes. That rule uniquely picks /api/search/site out of the 90 API
routes in the manifest, and rejects near misses such as /api/forum/search. Each
candidate then has to mint a real session before the fixture is written, so a
dead URL cannot be published again.

A failed startup was also permanent and silent: _request() returned early
whenever there was no session and nothing re-minted one, so a container that
lost the mint at boot served no HLTB metadata for its whole lifetime with no
error after the startup warning. Failures are now logged, and lookups mint
lazily behind a lock so a scan's concurrent lookups do not each hit /init.

Fixes #4285

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-26 14:19:31 -05:00
Georges-Antoine Assi
547c64c4f5 update hltb api 2026-05-09 12:56:01 -04:00
Georges-Antoine Assi
ec8583016b mega ton of fixes for 4.8 2026-04-03 10:54:31 -04:00
Georges-Antoine Assi
257d0ef669 Update hltb_api_url 2026-02-06 11:49:53 -05:00
Georges-Antoine Assi
03ca2ae681 replace amp with ampersnad 2026-01-29 13:16:06 -05:00
Georges-Antoine Assi
58e16d9c69 [ROMM-2949] Add support for shortfile scummvm names 2026-01-29 11:12:35 -05:00
Georges-Antoine Assi
4e0556c55b [HOTFIX] Fetch security token for HLTB 2025-12-15 09:47:07 -05:00
github-actions[bot]
65dce4860c Update HLTB API URL [skip CI] 2025-11-18 17:09:34 +00:00
Georges-Antoine Assi
8d91362a24 cahgnes from self review 2025-11-17 15:35:08 -05:00
Georges-Antoine Assi
3d6ba6c766 update hltb api url 2025-11-17 14:46:42 -05:00
Georges-Antoine Assi
5a4eb275cf update hltb api url 2025-11-15 10:37:03 -05:00
Georges-Antoine Assi
9eec973167 update hltb api url 2025-11-10 18:28:21 -05:00
Georges-Antoine Assi
2026fba710 bump html API url 2025-10-22 21:53:02 -04:00
Georges-Antoine Assi
c350a03be9 commit hltb api url 2025-10-09 16:31:11 -04:00
Georges-Antoine Assi
a7cf0d389a run trunk format on all files 2024-05-21 10:18:13 -04:00
Georges-Antoine Assi
880345f20c ruff-only pre-commit 2024-05-18 12:05:57 -04:00
Georges-Antoine Assi
9ad28f3294 more refactoring again 2024-05-05 16:32:40 -04:00