Skip to content

Commit

Permalink
Correctly check for file extension instead of looking for an extensio…
Browse files Browse the repository at this point in the history
…n anywhere in the full filename
  • Loading branch information
pannal committed Jul 26, 2024
1 parent 440a545 commit 2776575
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kodi_addon_checker/check_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def check_for_invalid_xml_files(report: Report, file_index: list):
addons
"""
for file in file_index:
if ".xml" in file["name"]:
if os.path.splitext(file["name"])[1].lower() == ".xml":
xml_path = os.path.join(file["path"], file["name"])
try:
# Just try if we can successfully parse it
Expand All @@ -39,7 +39,7 @@ def check_for_invalid_json_files(report: Report, file_index: list):
addons
"""
for file in file_index:
if ".json" in file["name"]:
if os.path.splitext(file["name"])[1].lower() == ".json":
path = os.path.join(file["path"], file["name"])
try:
# Just try if we can successfully parse it
Expand Down

0 comments on commit 2776575

Please sign in to comment.