Improve core selection logic
This commit is contained in:
@@ -34,6 +34,7 @@ class RetroarchSourceIterator(SourceIterator):
|
|||||||
source: "RetroarchSource"
|
source: "RetroarchSource"
|
||||||
|
|
||||||
def generator_builder(self) -> SourceIterationResult:
|
def generator_builder(self) -> SourceIterationResult:
|
||||||
|
# Get all playlist files, ending in .lpl
|
||||||
playlist_files = self.source.config_location["playlists"].glob("*.lpl")
|
playlist_files = self.source.config_location["playlists"].glob("*.lpl")
|
||||||
|
|
||||||
for playlist_file in playlist_files:
|
for playlist_file in playlist_files:
|
||||||
@@ -48,13 +49,15 @@ class RetroarchSourceIterator(SourceIterator):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
for item in playlist_json["items"]:
|
for item in playlist_json["items"]:
|
||||||
# Select the core. Try the content's core first, then the playlist's
|
# Select the core.
|
||||||
# default core.
|
# Try the content's core first, then the playlist's default core.
|
||||||
core_path = item["core_path"]
|
# If none can be used, warn the user and continue.
|
||||||
if core_path == "DETECT":
|
for core_path in (
|
||||||
default_core = playlist_json["default_core_path"]
|
item["core_path"],
|
||||||
if default_core:
|
playlist_json["default_core_path"],
|
||||||
core_path = default_core
|
):
|
||||||
|
if core_path != "DETECT":
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
logging.warning("Cannot find core for: %s", str(item["path"]))
|
logging.warning("Cannot find core for: %s", str(item["path"]))
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user