fix: process roms in consistent order (#2696)

This commit is contained in:
briaguya 2023-04-11 18:24:36 -04:00 committed by GitHub
parent fe71cdfbb6
commit 82b6c48497
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 10 deletions

View File

@ -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()