mirror of
https://github.com/rommapp/romm.git
synced 2026-12-04 21:02:21 +01:00
re-fetch screenshots only when changed game match
This commit is contained in:
@@ -320,9 +320,11 @@ async def update_rom(
|
||||
)
|
||||
|
||||
if remove_cover:
|
||||
cleaned_data.update(fs_resource_handler.remove_cover(
|
||||
rom_name=cleaned_data["name"], platform_fs_slug=platform_fs_slug
|
||||
))
|
||||
cleaned_data.update(
|
||||
fs_resource_handler.remove_cover(
|
||||
rom_name=cleaned_data["name"], platform_fs_slug=platform_fs_slug
|
||||
)
|
||||
)
|
||||
else:
|
||||
cleaned_data.update(
|
||||
fs_resource_handler.get_rom_cover(
|
||||
@@ -333,13 +335,17 @@ async def update_rom(
|
||||
)
|
||||
)
|
||||
|
||||
cleaned_data.update(
|
||||
fs_resource_handler.get_rom_screenshots(
|
||||
platform_fs_slug=platform_fs_slug,
|
||||
rom_name=cleaned_data["name"],
|
||||
url_screenshots=cleaned_data.get("url_screenshots", []),
|
||||
),
|
||||
)
|
||||
if (
|
||||
cleaned_data["igdb_id"] != db_rom.igdb_id
|
||||
or cleaned_data["moby_id"] != db_rom.moby_id
|
||||
):
|
||||
cleaned_data.update(
|
||||
fs_resource_handler.get_rom_screenshots(
|
||||
platform_fs_slug=platform_fs_slug,
|
||||
rom_name=cleaned_data["name"],
|
||||
url_screenshots=cleaned_data.get("url_screenshots", []),
|
||||
),
|
||||
)
|
||||
|
||||
if artwork is not None:
|
||||
file_ext = artwork.filename.split(".")[-1]
|
||||
|
||||
@@ -154,10 +154,13 @@ class FSResourceHandler(FSHandler):
|
||||
rom_name: str,
|
||||
platform_fs_slug: str,
|
||||
):
|
||||
shutil.rmtree(
|
||||
os.path.join(RESOURCES_BASE_PATH, platform_fs_slug, rom_name, "cover")
|
||||
)
|
||||
return { "path_cover_s": "", "path_cover_l": "" }
|
||||
try:
|
||||
shutil.rmtree(
|
||||
os.path.join(RESOURCES_BASE_PATH, platform_fs_slug, rom_name, "cover")
|
||||
)
|
||||
except FileNotFoundError:
|
||||
log.warning(f"Couldn't remove {rom_name} cover")
|
||||
return {"path_cover_s": "", "path_cover_l": ""}
|
||||
|
||||
@staticmethod
|
||||
def build_artwork_path(rom_name: str, platform_fs_slug: str, file_ext: str):
|
||||
|
||||
Reference in New Issue
Block a user