fix manual matching

This commit is contained in:
Georges-Antoine Assi
2025-03-11 00:41:04 -04:00
parent 1f78e29a30
commit a6b4ed0380
2 changed files with 15 additions and 7 deletions

View File

@@ -62,10 +62,6 @@ emitter?.on("showMatchRomDialog", (romToSearch) => {
romToSearch.igdb_id || romToSearch.moby_id || romToSearch.ss_id
? (romToSearch.name ?? "")
: romToSearch.fs_name_no_tags;
if (searchTerm.value) {
searchRom();
}
});
const missingCoverImage = computed(() =>
getMissingCoverImage(rom.value?.name || rom.value?.fs_name || ""),
@@ -207,7 +203,19 @@ async function updateRom(selectedRom: SearchRomSchema) {
show.value = false;
emitter?.emit("showLoadingDialog", { loading: true, scrim: true });
Object.assign(rom.value, selectedRom);
// Set the properties from the selected rom
rom.value = {
...rom.value,
igdb_id: selectedRom.igdb_id,
moby_id: selectedRom.moby_id,
ss_id: selectedRom.ss_id,
name: selectedRom.name,
slug: selectedRom.slug,
summary: selectedRom.summary,
url_cover: selectedRom.url_cover,
};
// Replace the cover image with a higher resolution
if (rom.value.url_cover) {
rom.value.url_cover = rom.value.url_cover.replace("t_cover_big", "t_1080p");
}

View File

@@ -8,7 +8,7 @@ import storeGalleryFilter from "@/stores/galleryFilter";
import { type Platform } from "@/stores/platforms";
import type { ExtractPiniaStoreType } from "@/types";
import { getStatusKeyForText } from "@/utils";
import { groupBy, isNull, uniqBy } from "lodash";
import { groupBy, isNull, isUndefined, uniqBy } from "lodash";
import { nanoid } from "nanoid";
import { defineStore } from "pinia";
@@ -372,7 +372,7 @@ export default defineStore("roms", {
this.lastSelectedIndex = -1;
},
isSimpleRom(rom: SimpleRom | SearchRomSchema): rom is SimpleRom {
return (rom as SimpleRom).id !== undefined;
return !isNull(rom.id) && !isUndefined(rom.id);
},
},
});