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

nightly
YozoraXCII 2 days ago committed by GitHub Action
parent 94a511b436
commit 34f3d040b7

@ -43,3 +43,5 @@ Removed Blog from the Navigation due to lack of time for updating/maintaining it
Fixes #2354 by updating version of tmdbapi dependency Fixes #2354 by updating version of tmdbapi dependency
Added Start Time, Finished and Run Time to Summary of run. 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,6 +152,11 @@ class DataFile:
content_path = os.path.abspath(os.path.join(file_path, "default.yml") if translation else file_path) content_path = os.path.abspath(os.path.join(file_path, "default.yml") if translation else file_path)
dir_path = file_path dir_path = file_path
if not os.path.exists(content_path): if not os.path.exists(content_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:
if file_type == "Default": if file_type == "Default":
raise Failed(f"File Error: Default does not exist {file_path}") raise Failed(f"File Error: Default does not exist {file_path}")
else: else:

Loading…
Cancel
Save