x360 fixes rom library

This commit is contained in:
Dragoon Dorise 2024-07-01 13:18:36 +02:00
parent fece626c1a
commit 8452bd7c1c
3 changed files with 4 additions and 6 deletions

View File

@ -172,7 +172,7 @@
/run/media/mmcblk0p1/Emulation/roms/vsmile
/run/media/mmcblk0p1/Emulation/roms/wasm4
/run/media/mmcblk0p1/Emulation/roms/wii
/run/media/mmcblk0p1/Emulation/roms/wiiu/roms
/run/media/mmcblk0p1/Emulation/roms/wiiu
/run/media/mmcblk0p1/Emulation/roms/wonderswan
/run/media/mmcblk0p1/Emulation/roms/wonderswancolor
/run/media/mmcblk0p1/Emulation/roms/x1

View File

@ -1,4 +1,4 @@
collection: Microsoft Xbox 360
shortname: xbox360
extensions: iso, ISO, xex, XEX, zar, ZAR
launch: /run/media/mmcblk0p1/Emulation/tools/launchers/xenia.sh "Z:{file.path}"
launch: /run/media/mmcblk0p1/Emulation/tools/launchers/xenia.sh "'Z:{file.path}'"

View File

@ -43,8 +43,6 @@ def generate_game_lists(roms_path):
valid_system_dirs = []
for system_dir in os.listdir(roms_dir):
if system_dir == "wiiu":
system_dir = "wiiu/roms"
if system_dir == "xbox360":
system_dir = "xbox360/roms"
full_path = os.path.join(roms_dir, system_dir)
@ -56,14 +54,14 @@ def generate_game_lists(roms_path):
game_list = []
for system_dir in valid_system_dirs:
if any(x in system_dir for x in ["/ps3", "/xbox360", "/model2", "/genesiswide", "/mame", "/emulators", "/desktop"]):
if any(x in system_dir for x in ["/ps3", "/model2", "/genesiswide", "/mame", "/emulators", "/desktop"]):
continue
with open(os.path.join(system_dir, 'metadata.txt')) as f:
metadata = f.read()
collection = next((line.split(':')[1].strip() for line in metadata.splitlines() if line.startswith('collection:')), '')
shortname = next((line.split(':')[1].strip() for line in metadata.splitlines() if line.startswith('shortname:')), '')
launcher = next((line.split(':')[1].strip() for line in metadata.splitlines() if line.startswith('launch:')), '').replace('"', '\\"')
launcher = next((line.split(':', 1)[1].strip() for line in metadata.splitlines() if line.startswith('launch:')), '').replace('"', '\\"')
extensions = next((line.split(':')[1].strip().replace(',', ' ') for line in metadata.splitlines() if line.startswith('extensions:')), '').split()
games = collect_game_data(system_dir, extensions)