mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 18:11:16 +01:00
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>