Merge pull request #1744 from rommapp/romm-1742

[ROMM-1742] Fix updating cover when manual matching
This commit is contained in:
Georges-Antoine Assi
2025-03-16 23:07:05 -04:00
committed by GitHub
2 changed files with 9 additions and 9 deletions

View File

@@ -443,7 +443,7 @@ async def update_rom(
request (Request): Fastapi Request object
id (Rom): Rom internal id
rename_as_source (bool, optional): Flag to rename rom file as matched IGDB game. Defaults to False.
artwork (UploadFile, optional): Custom artork to set as cover. Defaults to File(None).
artwork (UploadFile, optional): Custom artwork to set as cover. Defaults to File(None).
unmatch_metadata: Remove the metadata matches for this game. Defaults to False.
Raises:

View File

@@ -177,11 +177,7 @@ function selectCover(source: MatchedSource) {
function confirm() {
if (!selectedMatchRom.value || !selectedCover.value) return;
updateRom(
Object.assign(selectedMatchRom.value, {
url_cover: selectedCover.value.url_cover,
}),
);
updateRom(selectedMatchRom.value, selectedCover.value.url_cover);
closeDialog();
}
@@ -197,7 +193,10 @@ function backToMatched() {
renameAsSource.value = false;
}
async function updateRom(selectedRom: SearchRomSchema) {
async function updateRom(
selectedRom: SearchRomSchema,
urlCover: string | undefined,
) {
if (!rom.value) return;
show.value = false;
@@ -213,9 +212,10 @@ async function updateRom(selectedRom: SearchRomSchema) {
slug: selectedRom.slug,
summary: selectedRom.summary,
url_cover:
selectedRom.moby_url_cover ||
selectedRom.igdb_url_cover ||
urlCover ||
selectedRom.ss_url_cover ||
selectedRom.igdb_url_cover ||
selectedRom.moby_url_cover ||
null,
};