From 5bce15776584854aa61dcfdae20654c4e4a77583 Mon Sep 17 00:00:00 2001 From: Sam Dornan Date: Fri, 4 Sep 2026 10:19:17 -0500 Subject: [PATCH] refactor(export): trim the gamelist media comments to the non-obvious why Co-Authored-By: Claude Fable 5.1 --- backend/config/config_manager.py | 4 +--- backend/tests/utils/test_gamelist_exporter.py | 7 ++----- backend/utils/gamelist_exporter.py | 3 +-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/backend/config/config_manager.py b/backend/config/config_manager.py index b0fa5d4c0..542c1d1bd 100644 --- a/backend/config/config_manager.py +++ b/backend/config/config_manager.py @@ -52,8 +52,7 @@ DEFAULT_EXCLUDED_FILES: Final = [ "gamelist.xml", "metadata.pegasus.txt", ] -# ES-DE ignores media paths in gamelist.xml and only looks in -# ///, so these folders sit beside the ROMs. +# ES-DE resolves media at ///.. GAMELIST_MEDIA_DIRS: Final[dict[str, str]] = { "box2d": "covers", "box3d": "3dboxes", @@ -73,7 +72,6 @@ DEFAULT_EXCLUDED_DIRS: Final = [ "@eaDir", "assets", *GAMELIST_MEDIA_DIRS.values(), - # RetroBat's scraper writes images/ beside the ROMs. "images", "__MACOSX", "#recycle", diff --git a/backend/tests/utils/test_gamelist_exporter.py b/backend/tests/utils/test_gamelist_exporter.py index ac24df2bd..2be87a670 100644 --- a/backend/tests/utils/test_gamelist_exporter.py +++ b/backend/tests/utils/test_gamelist_exporter.py @@ -562,9 +562,7 @@ async def test_export_platform_to_file_omits_tags_when_copy_fails( async def test_export_platform_to_file_uses_esde_media_dirs( platform_with_roms, isolated_filesystem ): - """ES-DE resolves media by ///. and - ignores media paths in gamelist.xml, so 3D boxes and physical media must land - in the folder names ES-DE expects, directly inside the platform directory.""" + """3D boxes and physical media land in ES-DE's folder names beside the ROMs.""" resources_base, library_base = isolated_filesystem platform, roms = platform_with_roms @@ -633,8 +631,7 @@ async def test_exported_media_dirs_are_excluded_from_scan( async def test_export_platform_to_file_reuses_existing_esde_media( platform_with_roms, isolated_filesystem ): - """Media already scraped by ES-DE into /covers/ is kept as-is instead - of being duplicated on export.""" + """Media already scraped by ES-DE into /covers/ is left untouched.""" resources_base, library_base = isolated_filesystem platform, _ = platform_with_roms diff --git a/backend/utils/gamelist_exporter.py b/backend/utils/gamelist_exporter.py index ae4bff9a0..20469461e 100644 --- a/backend/utils/gamelist_exporter.py +++ b/backend/utils/gamelist_exporter.py @@ -251,8 +251,7 @@ class GamelistExporter: if rom.gamelist_id: SubElement(game, "id").text = str(rom.gamelist_id) - # ES-DE and RetroBat name the same media differently, so both tags are - # written; each frontend ignores the tags it does not know. + # RetroBat reads the same media under its own tag names. asset_tags: list[tuple[str, str]] = [ ("box3d", "box3d"), ("box2d_back", "boxback"),