diff --git a/.romm/.env b/.romm/.env index 53d32d9..49e9232 100644 --- a/.romm/.env +++ b/.romm/.env @@ -1,6 +1,6 @@ HOST="" USERNAME="" PASSWORD="" -# INCLUDE_PLATFORMS and EXCLUDE_PLATFORMS are mutially exclusive. If you define one, the other will be ignored. INCLUDE_PLATFORMS will take precedence. +# INCLUDE_PLATFORMS and EXCLUDE_PLATFORMS are mutually exclusive. If you define one, the other will be ignored. INCLUDE_PLATFORMS will take precedence. INCLUDE_PLATFORMS=["gb", "gba", "gbc", "nes", "snes"] EXCLUDE_PLATFORMS=["win", "n3ds"] diff --git a/.romm/api/api.py b/.romm/api/api.py index 4d529e5..92fabe9 100644 --- a/.romm/api/api.py +++ b/.romm/api/api.py @@ -27,11 +27,11 @@ def __init__(self): "utf-8" ) self.__headers = {"Authorization": f"Basic {self.__auth_token}"} - self.__platforms = [] - self.__exclude_platforms = os.getenv("EXCLUDE_PLATFORMS", []) + self.__exclude_platforms = set(os.getenv("EXCLUDE_PLATFORMS") or []) + self.__include_collections = set(os.getenv("INCLUDE_COLLECTIONS") or []) + self.__exclude_collections = set(os.getenv("EXCLUDE_COLLECTIONS") or []) self.__collections = [] - self.__include_collections = os.getenv("INCLUDE_COLLECTIONS", []) - self.__exclude_collections = os.getenv("EXCLUDE_COLLECTIONS", []) + self.__platforms = [] self.__roms = [] @staticmethod @@ -186,90 +186,92 @@ def download_rom(self, rom, dest_path): return (True, True) -MUOS_SUPPORTED_PLATFORMS = [ - "acpc", - "arcade", - "arduboy", - "atari2600", - "atari5200", - "atari7800", - "jaguar", - "lynx", - "atari-st", - "wonderswan", - "wonderswan-color", - "cave-story", - "chailove", - "chip-8", - "colecovision", - "amiga", - "c128", - "c64", - "cpet", - "vic-20", - "dos", - "doom", - "fairchild-channel-f", - "vectrex", - "galaksija", - "g-and-w", - "j2me", - "lowres", - "lua", - "odyssey--1", - "intellivision", - "mega-duck-slash-cougar-boy", - "msx", - "turbografx-16-slash-pc-engine-cd", - "supergrafx", - "turbografx16--1", - "pc-8000", - "pc-fx", - "pc-9800-series", - "nds", - "fds", - "gba", - "gbc", - "gb", - "n64", - "nes", - "famicom", - "snes", - "sfam", - "pokemon-mini", - "virtualboy", - "openbor", - "pico-8", - "philips-cd-i", - "quake", - "rpg-maker", - "neogeoaes", - "neogeomvs", - "neo-geo-cd", - "neo-geo-pocket", - "neo-geo-pocket-color", - "scummvm", - "sega-32x", - "dc", - "gamegear", - "sega-master-system", - "genesis-slash-megadrive", - "sega-pico", - "segacd", - "sg1000", - "saturn", - "x1", - "sharp-x68000", - "sinclair-zx81", - "zxs", - "ps", - "psp", - "tic-80", - "ti-83", - "3do", - "uzebox", - "vemulator", - "wasm-4", - "watara-slash-quickshot-supervision", - "wolfenstein-3d", -] +MUOS_SUPPORTED_PLATFORMS = frozenset( + ( + "acpc", + "arcade", + "arduboy", + "atari2600", + "atari5200", + "atari7800", + "jaguar", + "lynx", + "atari-st", + "wonderswan", + "wonderswan-color", + "cave-story", + "chailove", + "chip-8", + "colecovision", + "amiga", + "c128", + "c64", + "cpet", + "vic-20", + "dos", + "doom", + "fairchild-channel-f", + "vectrex", + "galaksija", + "g-and-w", + "j2me", + "lowres", + "lua", + "odyssey--1", + "intellivision", + "mega-duck-slash-cougar-boy", + "msx", + "turbografx-16-slash-pc-engine-cd", + "supergrafx", + "turbografx16--1", + "pc-8000", + "pc-fx", + "pc-9800-series", + "nds", + "fds", + "gba", + "gbc", + "gb", + "n64", + "nes", + "famicom", + "snes", + "sfam", + "pokemon-mini", + "virtualboy", + "openbor", + "pico-8", + "philips-cd-i", + "quake", + "rpg-maker", + "neogeoaes", + "neogeomvs", + "neo-geo-cd", + "neo-geo-pocket", + "neo-geo-pocket-color", + "scummvm", + "sega-32x", + "dc", + "gamegear", + "sega-master-system", + "genesis-slash-megadrive", + "sega-pico", + "segacd", + "sg1000", + "saturn", + "x1", + "sharp-x68000", + "sinclair-zx81", + "zxs", + "ps", + "psp", + "tic-80", + "ti-83", + "3do", + "uzebox", + "vemulator", + "wasm-4", + "watara-slash-quickshot-supervision", + "wolfenstein-3d", + ) +)