Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: Use sets for membership comparisons #2

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .romm/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
HOST="<romm host>"
USERNAME="<romm user>"
PASSWORD="<romm 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"]
184 changes: 93 additions & 91 deletions .romm/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
)
)