diff --git a/backend/endpoints/rom.py b/backend/endpoints/rom.py index 795a28f4d..91202bbea 100644 --- a/backend/endpoints/rom.py +++ b/backend/endpoints/rom.py @@ -737,25 +737,24 @@ async def update_rom( cleaned_data.update( { - "url_cover": "", + "url_cover": f"http://local.internal/{path_cover_s}", # Fake url_cover to avoid overwriting "path_cover_s": path_cover_s, "path_cover_l": path_cover_l, } ) else: - if data.get( - "url_cover", "" - ) != rom.url_cover or not fs_resource_handler.cover_exists( + url_cover = data.get("url_cover", rom.url_cover) + if url_cover != rom.url_cover or not fs_resource_handler.cover_exists( rom, CoverSize.BIG ): path_cover_s, path_cover_l = await fs_resource_handler.get_cover( entity=rom, overwrite=True, - url_cover=str(data.get("url_cover") or ""), + url_cover=str(url_cover), ) cleaned_data.update( { - "url_cover": data.get("url_cover", rom.url_cover), + "url_cover": url_cover, "path_cover_s": path_cover_s, "path_cover_l": path_cover_l, } diff --git a/backend/handler/scan_handler.py b/backend/handler/scan_handler.py index 20aec585f..7066f4774 100644 --- a/backend/handler/scan_handler.py +++ b/backend/handler/scan_handler.py @@ -377,7 +377,7 @@ async def scan_rom( or ( scan_type == ScanType.PARTIAL and not rom.hasheous_id - and rom.slug in HASHEOUS_PLATFORM_LIST + and rom.platform_slug in HASHEOUS_PLATFORM_LIST ) or (scan_type == ScanType.UNIDENTIFIED and rom.is_unidentified) ) @@ -422,7 +422,7 @@ async def scan_rom( or ( scan_type == ScanType.PARTIAL and not rom.igdb_id - and rom.slug in IGDB_PLATFORM_LIST + and rom.platform_slug in IGDB_PLATFORM_LIST ) or (scan_type == ScanType.UNIDENTIFIED and rom.is_unidentified) ) @@ -501,7 +501,7 @@ async def scan_rom( or ( scan_type == ScanType.PARTIAL and not rom.moby_id - and rom.slug in MOBYGAMES_PLATFORM_LIST + and rom.platform_slug in MOBYGAMES_PLATFORM_LIST ) or (scan_type == ScanType.UNIDENTIFIED and rom.is_unidentified) ) @@ -522,7 +522,7 @@ async def scan_rom( or ( scan_type == ScanType.PARTIAL and not rom.ss_id - and rom.slug in SCREENSAVER_PLATFORM_LIST + and rom.platform_slug in SCREENSAVER_PLATFORM_LIST ) or (scan_type == ScanType.UNIDENTIFIED and rom.is_unidentified) ) @@ -540,7 +540,7 @@ async def scan_rom( or ( scan_type == ScanType.PARTIAL and not rom.launchbox_id - and rom.slug in LAUNCHBOX_PLATFORM_LIST + and rom.platform_slug in LAUNCHBOX_PLATFORM_LIST ) or (scan_type == ScanType.UNIDENTIFIED and rom.is_unidentified) ): @@ -561,7 +561,7 @@ async def scan_rom( or ( scan_type == ScanType.PARTIAL and not rom.ra_id - and rom.slug in RA_PLATFORM_LIST + and rom.platform_slug in RA_PLATFORM_LIST ) or (scan_type == ScanType.UNIDENTIFIED and rom.is_unidentified) ) @@ -590,7 +590,7 @@ async def scan_rom( or ( scan_type == ScanType.PARTIAL and not rom.hasheous_id - and rom.slug in HASHEOUS_PLATFORM_LIST + and rom.platform_slug in HASHEOUS_PLATFORM_LIST ) or (scan_type == ScanType.UNIDENTIFIED and rom.is_unidentified) ) diff --git a/frontend/src/services/api/rom.ts b/frontend/src/services/api/rom.ts index 80fab8abe..544652b63 100644 --- a/frontend/src/services/api/rom.ts +++ b/frontend/src/services/api/rom.ts @@ -259,8 +259,13 @@ async function updateRom({ formData.append("name", rom.name || ""); formData.append("fs_name", rom.fs_name); formData.append("summary", rom.summary || ""); - formData.append("url_cover", rom.url_cover || ""); - if (rom.artwork) formData.append("artwork", rom.artwork); + + // Don't set url_cover on manual artwork upload + if (rom.artwork) { + formData.append("artwork", rom.artwork); + } else { + formData.append("url_cover", rom.url_cover || ""); + } return api.put(`/roms/${rom.id}`, formData, { params: {