Merge pull request #1177 from rommapp/fix/use-filename-when-matching-unmatched-rom

fix: Use filename without tags or extension when matching unmatched game
This commit is contained in:
Michael Manganiello
2024-09-06 10:25:38 -03:00
committed by GitHub

View File

@@ -39,9 +39,16 @@ const isIGDBFiltered = ref(true);
const isMobyFiltered = ref(true);
emitter?.on("showMatchRomDialog", (romToSearch) => {
rom.value = romToSearch;
searchTerm.value = romToSearch.name || romToSearch.file_name_no_tags || "";
show.value = true;
if (rom.value.igdb_id || rom.value.moby_id) {
// Use name as search term, only when it's matched
// Otherwise use the filename without tags and extensions
searchTerm.value =
romToSearch.igdb_id || romToSearch.moby_id
? (romToSearch.name ?? "")
: romToSearch.file_name_no_tags;
if (searchTerm.value) {
searchRom();
}
});