From 744d92d6d187ad3265f45f17e740eac32cc3f373 Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Wed, 11 Mar 2026 21:05:01 -0400 Subject: [PATCH] lower fs name --- backend/handler/filesystem/roms_handler.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/handler/filesystem/roms_handler.py b/backend/handler/filesystem/roms_handler.py index 4acf5460e..39f75f7bf 100644 --- a/backend/handler/filesystem/roms_handler.py +++ b/backend/handler/filesystem/roms_handler.py @@ -60,6 +60,10 @@ COMPRESSED_FILE_EXTENSIONS = frozenset( ) ) +# PICO-8 cartridges are often stored as PNG files +PICO8_CARTRIDGE_EXTENSION = ".p8.png" + + # CHD (Compressed Hunks of Data) v5 format constants # See: https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h CHD_SIGNATURE: Final = b"MComprHD" @@ -105,8 +109,6 @@ NON_HASHABLE_PLATFORMS = frozenset( FILE_READ_CHUNK_SIZE = 1024 * 8 -PICO8_CARTRIDGE_EXTENSION = ".p8.png" - class FSRom(TypedDict): fs_name: str @@ -740,7 +742,9 @@ class FSRomsHandler(FSHandler): the cartridge label/cover art. When such a ROM is found we can use the file itself as the cover instead of fetching one from an external source. """ - if platform_slug == UPS.PICO and fs_name.endswith(PICO8_CARTRIDGE_EXTENSION): + if platform_slug == UPS.PICO and fs_name.lower().endswith( + PICO8_CARTRIDGE_EXTENSION + ): rom_path = self.validate_path(f"{fs_path}/{fs_name}") return f"file://{rom_path}" return None