[31] Check for `.yaml` extension if `.yml` is not found and vice-versa (#2372)

nightly
YozoraXCII 1 day ago committed by GitHub Action
parent 94a511b436
commit 34f3d040b7

@ -42,4 +42,6 @@ Fixes an issue causing IMDB collection to fail due to duplicate keys
Removed Blog from the Navigation due to lack of time for updating/maintaining it
Fixes #2354 by updating version of tmdbapi dependency
Added Start Time, Finished and Run Time to Summary of run.
Fixed an issue where custom repositories would not work correctly if the URL did not end in a trailing `/` character.
Fixed an issue where custom repositories would not work correctly if the URL did not end in a trailing `/` character.
Kometa will now check for `.yaml` extension in filenames if `.yml` is not found and vice-versa

@ -1 +1 @@
2.1.0-build30
2.1.0-build31

@ -152,10 +152,15 @@ class DataFile:
content_path = os.path.abspath(os.path.join(file_path, "default.yml") if translation else file_path)
dir_path = file_path
if not os.path.exists(content_path):
if file_type == "Default":
raise Failed(f"File Error: Default does not exist {file_path}")
if content_path.endswith(".yml") and os.path.exists(content_path[:-4] + ".yaml"):
content_path = content_path[:-4] + ".yaml"
elif content_path.endswith(".yaml") and os.path.exists(content_path[:-5] + ".yml"):
content_path = content_path[:-5] + ".yml"
else:
raise Failed(f"File Error: File does not exist {content_path}")
if file_type == "Default":
raise Failed(f"File Error: Default does not exist {file_path}")
else:
raise Failed(f"File Error: File does not exist {content_path}")
yaml = self.config.Requests.file_yaml(content_path, check_empty=True)
if not translation:
logger.debug(f"File Loaded From: {content_path}")

Loading…
Cancel
Save