summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbriaguya <70942617+briaguya-ai@users.noreply.github.com>2023-04-11 18:24:36 -0400
committerGitHub <noreply@github.com>2023-04-11 18:24:36 -0400
commit0552057cf9ff04d0bffa4f6c724c8c0402c13659 (patch)
tree4ff06c25fa1fc56d4480fada3da142bd97bd7b1d
parentaa1b7458f61bdaaf5c43775c7ee87787a672e017 (diff)
fix: process roms in consistent order (#2696)
-rw-r--r--rom_chooser.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/rom_chooser.py b/rom_chooser.py
index bdee088..fa5fcc2 100644
--- a/rom_chooser.py
+++ b/rom_chooser.py
@@ -18,17 +18,14 @@ def chooseROM(verbose=False, non_interactive=False):
return roms
if non_interactive:
- romsToExtract = []
- foundMq = False
- foundOot = False
+ mq_rom = None
+ non_mq_rom = None
for rom in roms:
- if rom.isMq and not foundMq:
- romsToExtract.append(rom)
- foundMq = True
- elif not rom.isMq and not foundOot:
- romsToExtract.append(rom)
- foundOot = True
- return romsToExtract
+ if rom.isMq and mq_rom is None:
+ mq_rom = rom
+ elif not rom.isMq and non_mq_rom is None:
+ non_mq_rom = rom
+ return [rom for rom in [non_mq_rom, mq_rom] if rom is not None]
print(f"{len(roms)} roms found, please select one by pressing 1-{len(roms)}")
print()