This commit is contained in:
Georges-Antoine Assi
2026-05-24 14:07:45 -04:00
parent acc1e630b7
commit 8af556ee46
2 changed files with 13 additions and 4 deletions

View File

@@ -367,7 +367,10 @@ class GamelistHandler(MetadataHandler):
for game in root:
if game.tag not in ("game", "folder"):
continue
path_elem = game.find("path")
if path_elem is None or path_elem.text is None:
continue
# Handle relative paths
rom_path = path_elem.text

View File

@@ -17,7 +17,8 @@ MOCK_METADATA = {
def test_parse_gamelist_xml_includes_folder_entries(tmp_path: Path, platform: Platform):
gamelist_path = tmp_path / "gamelist.xml"
gamelist_path.write_text("""<?xml version="1.0"?>
gamelist_path.write_text(
"""<?xml version="1.0"?>
<gameList>
<folder>
<path>./Subfolder</path>
@@ -26,7 +27,9 @@ def test_parse_gamelist_xml_includes_folder_entries(tmp_path: Path, platform: Pl
<lang>en, fr</lang>
<region>us, eu</region>
</folder>
</gameList>""", encoding="utf-8")
</gameList>""",
encoding="utf-8",
)
handler = GamelistHandler()
with (
@@ -51,13 +54,16 @@ def test_parse_gamelist_xml_includes_folder_entries(tmp_path: Path, platform: Pl
def test_parse_gamelist_xml_keeps_game_entries(tmp_path: Path, platform: Platform):
gamelist_path = tmp_path / "gamelist.xml"
gamelist_path.write_text("""<?xml version="1.0"?>
gamelist_path.write_text(
"""<?xml version="1.0"?>
<gameList>
<game>
<path>./test-rom.zip</path>
<name>Game Entry</name>
</game>
</gameList>""", encoding="utf-8")
</gameList>""",
encoding="utf-8",
)
handler = GamelistHandler()
with (