Files
romm/backend/tests/handler/metadata/hltb_game_page_example.json
Sam Dornan e7440a2dfc fix(hltb): fetch metadata when a HowLongToBeat ID is set by hand
`update_rom` fetches from every metadata provider whose ID changed, except
HLTB, which had no by-ID lookup at all. A hand-entered ID was stored and the
How Long to Beat tab stayed empty.

HLTB's API only exposes search, so `get_rom_by_id` reads the record from the
`__NEXT_DATA__` payload the game page already ships. The canonical
`/game/{id}` path is requested directly, as `/game?id=` answers with a
redirect the shared httpx client does not follow, and the game page dates a
release in full where search returns just the year.

A page RomM can no longer read raises 502 naming the cause instead of
reporting a game with no times, since that failure is otherwise
indistinguishable from the bug this fixes.

Fixes #2926

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 20:19:26 -05:00

33 lines
1017 B
JSON

{
"props": {
"pageProps": {
"game": {
"data": {
"game": [
{
"game_id": 7169,
"game_name": "Pokémon Red and Blue",
"count_comp": 5364,
"count_review": 1762,
"review_score": 81,
"game_alias": "Pokemon Red and Blue, Pokemon Green, Pocket Monsters Red, Pocket Monsters Green, Pocket Monsters Blue, Pokemon Blue Version, Pokemon Red Version, Pokemon Green Version",
"game_image": "7169_Pokmon_Red_and_Blue.png",
"game_type": "game",
"profile_platform": "Game Boy",
"release_world": "1996-02-27",
"comp_all_count": 1174,
"comp_all": 139926,
"comp_main_count": 594,
"comp_main": 92822,
"comp_plus_count": 378,
"comp_plus": 156016,
"comp_100_count": 202,
"comp_100": 354756
}
]
}
}
}
}
}