mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 14:56:01 +00:00
The SS metadata handler pre-encoded the name-search term with quote() before handing it to the service layer, which percent-encodes the query again via yarl's with_query(). This double-encoded any character that needs URL-encoding (e.g. "+" -> "%2B" -> "%252B"), so the request URL carried a doubly-escaped term. Pass the raw (unidecode-transliterated but un-percent-encoded) term to search_games() in both _search_rom() and get_matched_roms_by_name() and let the URL builder encode it exactly once. The scan now sends e.g. recherche=...%2B... instead of ...%252B... This is a request-correctness fix. It does not, on its own, make every previously-unmatched title match: ScreenScraper's jeuRecherche normalizes punctuation and applies its own relevance ranking, so some titles still return no results for the full filename-derived term (verified directly against the API). Improving name-search robustness is a separate concern. Add TestSearchTermEncoding regression tests covering the un-pre-encoded term, preserved unidecode transliteration, and a single-encoded request URL (%2B, never %252B). Written primarily by Claude Code. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>