Four findings trunk reports on files this branch adds, none of which CI
tolerates.
`_make_game` claimed `dict`, so passing it to `extract_metadata_from_igdb_rom`
(which takes `Game`) was an arg-type error. It builds a real `Game` now.
`Game` is `total=False` over a base that requires `id`, so the three keys the
factory set to `None` are simply absent instead: every reader goes through
`.get()`, which cannot tell the two apart. `alternative_names` and
`game_localizations` need their element type spelled out, because mypy will not
push a union context into a dict literal.
`series_keys` takes a `Rom` and the diversity tests pass a stand-in, for the
reason the module docstring gives. Cast at the one call that reaches a
`Rom`-typed signature rather than grow the fake a database row's worth of
attributes.
`backfill_igdb_tags` reads fields named by a loop variable, which a TypedDict
answers as `object`. It reads through a plain-mapping view instead.
Bandit read `token == "--report"` as a hardcoded password on the strength of
the variable's name. Renamed, rather than suppressed.
IGDB sends the main franchise both on its own (`franchise`) and inside
`franchises`, and the two were concatenated with `pydash.compact`, which
drops falsy values but not duplicates. The repeat is stored and rendered,
so the details page shows "Happy Feet, Happy Feet".
Measured on a 14,952-game library: 1,080 of 8,788 games carrying a
franchise carried it twice (12.3%).
`pydash.uniq` keeps first-seen order, so `franchises[0]` -- which the
gamelist exporter writes out as <family> -- is unchanged.
Existing libraries keep the repeat until the affected games are rescanned.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`involved_companies` carries one entry per involvement, so a studio
credited twice in the same role landed in `developers` twice. The two
role lists legitimately overlap where a studio both made and shipped a
game; neither may repeat internally.
The equivalent fix for the merged `companies` list and for `franchises`
is upstream in rommapp/romm#4175, since those exist on master.
Co-Authored-By: Claude Opus 5 <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>
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>
IGDB catalogues a console and its regional twin as two separate
platforms (SNES/Super Famicom, NES/Famicom). RomM locked each IGDB
search to a single platform id, so a region-exclusive title catalogued
under only the twin — e.g. the Japan-only Super Famicom game
"Rudra no Hihou" (platform 58) scanned from an `snes` folder
(platform 19) — was filtered out before name matching ran and never
matched.
Include a platform's regional twin in the IGDB platform filter so both
are searched. A non-twin platform keeps the exact existing query
(`platforms=[19]`); a twin produces an OR group
(`(platforms=[19] | platforms=[58])`), leaving all other platforms and
recorded cassettes unchanged.
Written primarily by Claude Code.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
IGDB scans dropped games whose filename uses a localized (non-English)
title even when that title exists in IGDB's alternative_names. The
alternative_name wildcard search surfaced the correct game, but
_search_rom() rebuilt its name->game candidate dict using only the
primary English name, so the Jaro-Winkler re-check scored the localized
term below threshold and discarded the match (issue #3435).
Add _index_games_by_searchable_name(), which indexes each game by its
primary name plus alternative_names and game_localizations titles, and
use it for both candidate-building passes in _search_rom(). Primary
names keep precedence (lowest-igdb-id tiebreak); alternative/
localization titles fill in only names not already claimed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Add `STANDALONE_EXPANSION` game type to the `with_game_type` filter in
`_search_rom` so games like "Ecco: The Tides of Time" (which IGDB classifies
as a standalone expansion) are included in the first search pass and are not
confused with their parent game ("Ecco The Dolphin")
- Fix the expanded search fallback to fetch and compare ALL unique game IDs
returned by the IGDB search endpoint, instead of only the first result
- Add tests to verify both fixes
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/d6a0c1dd-e541-4d8e-a272-9e5511a2077e
Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>