fix(igdb): match ROMs by localized/alternative titles in scan#3461
Merged
Conversation
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 rommapp#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>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes IGDB scan matching when filenames use localized/alternative titles. The candidate-name index used for Jaro-Winkler matching now includes each game's alternative_names and game_localizations titles, not only the primary English name. Closes #3435.
Changes:
- Adds
_index_games_by_searchable_name()that indexes games by primary name (lowest-id tiebreak) plus alt/localization titles (only when not already claimed). - Replaces both inline name→game dict builders in
_search_rom()with the new helper. - Adds
TestSearchRomLocalizedNamessuite and extends_make_game()to populatealternative_names/game_localizations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| backend/handler/metadata/igdb_handler.py | Adds the shared indexing helper and wires it into both candidate-building passes of _search_rom(). |
| backend/tests/handler/metadata/test_igdb_handler.py | Extends _make_game and adds regression/precedence tests for localized-title matching. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
gantoine
approved these changes
May 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IGDB scans silently dropped games whose filename uses a localized (non-English) title — even when that exact title exists in IGDB's alternative_names or game_localizations.
The root cause was in _search_rom(): IGDB's alternative_name wildcard search did surface the correct game, but the handler then rebuilt its name -> game candidate dict using only the primary English name. The Jaro-Winkler re-check therefore scored the localized search term against the English title alone, fell below the similarity threshold, and discarded the match.
Example (issue #3435): the No-Intro filename 007 - Die Welt Ist Nicht Genug never matched James Bond 007: The World Is Not Enough, despite the German title being present in IGDB's alternative_names.
What changed
No new IGDB requests — alternative_names.name and game_localizations.name were already requested in GAMES_FIELDS; this change just makes use of data already fetched.
Files modified
Testing notes
Reviewer notes
🤖 Written primarily by Claude Code (Opus 4.8), reviewed by the author.