Skip to content

Commit

Permalink
capture some more errors
Browse files Browse the repository at this point in the history
  • Loading branch information
YozoraXCII committed Jan 7, 2025
1 parent bd203aa commit 5510046
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
18 changes: 16 additions & 2 deletions kometa.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,10 @@ def start(attrs):
("No Items found for Overlay File", r"No Items found for Overlay File \(\d+\)\s*(.*)"),
("Plex Error: No matches found for", r"Plex Error: No matches found for .+ with regex pattern (.*)"),
("Plex Error:", r"Plex Error: (.*)"),
("Config Warning: Skipping duplicate collection:", r"Config Warning: Skipping duplicate collection: (.*)"),
("Config Warning: Other Collection", r"Config Warning: Other Collection (.*) not needed"),
("Metadata Error: Skipping", r"Metadata Error: Skipping (.*) as not found"),
("No Items found in Plex", r"No Items found in Plex that meet the criteria"),
("Tautulli Error:", r"Tautulli Error: (.*)"),
("GitHub Error:", r"GitHub Error: (.*)"),
("OMDb Error:", r"OMDb Error: (.*)"),
Expand Down Expand Up @@ -488,7 +492,7 @@ def start(attrs):
logger.info("")


elif key.startswith(("TMDb Error: No valid TMDb IDs in:","TMDb Error: No Collection found for TMDb ID","Overlay Error","Overlay Warning: Overlays attempted on","No Items found for Overlay File","Plex Error: No matches found for")) and key in other_message:
elif key.startswith(("TMDb Error: No valid TMDb IDs in:","TMDb Error: No Collection found for TMDb ID","Overlay Error","Overlay Warning: Overlays attempted on","No Items found for Overlay File","Plex Error: No matches found for","Config Warning: Skipping duplicate collection","Config Warning: Other Collection","Metadata Error: Skipping")) and key in other_message:
if builder_title is False:
logger.separator("Collection/Overlay/Playlist Errors", space=False, border=False)
logger.info("")
Expand All @@ -505,6 +509,13 @@ def start(attrs):
logger.info(f"Image Not Found in Plex (Error 404) when attempting Overlays on:")
elif key.startswith(("No Items found for Overlay File")):
logger.info(f"No items matched the criteria for the following overlays:")
elif key.startswith("Config Warning: Skipping duplicate collection"):
logger.info(f"The following collections have been called more than once so will be skipped:")
elif key.startswith("Config Warning: Other Collection"):
logger.info(f"Other Collections not created as all items fall into existing collections:")
elif key.startswith("Metadata Error: Skipping"):
logger.info(f"No Metadata Updates were made to the following items as they could not be found:")

formatted_list = ", ".join([f"'{item.strip('\'\"')}'" for item in other_message[key]["list"]])

# Check if the formatted_list exceeds 500 characters
Expand All @@ -521,13 +532,14 @@ def start(attrs):
convert_title = True
if key.startswith("Convert Warning"):
logger.info(f"{key[17:]}")

elif key.startswith("Filter Error"):
logger.info(f"{key[14:]}")
elif key.startswith("Trakt Error"):
logger.info(f"{key[13:]}")
elif key.startswith(("TMDb Error", "TVDb Error")) and "Invalid API key" not in key:
logger.info(f"{key[12:]}")


formatted_list = ", ".join([f"'{item.strip('\'\"')}'" for item in other_message[key]["list"]])

# Check if the formatted_list exceeds 500 characters
Expand All @@ -544,6 +556,8 @@ def start(attrs):
logger.info("")
asset_title = True
logger.info(f"{key[15:]}:")


formatted_list = ", ".join([f"'{item.strip('\'\"')}'" for item in other_message[key]["list"]])

# Check if the formatted_list exceeds 500 characters
Expand Down
2 changes: 1 addition & 1 deletion modules/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@ def update_metadata(self):
item.extend(temp_items)

if not item:
logger.error(f"Skipping {mapping_name}: Item not found")
logger.error(f"Metadata Error: Skipping {mapping_name} as not found")
continue

if not isinstance(item, list):
Expand Down
2 changes: 1 addition & 1 deletion modules/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ def parse(error, attribute, data, datatype=None, methods=None, parent=None, defa
if default is None:
raise Failed(f"{error} Error: {message}")
else:
logger.warning(f"{error} Warning: {message} using {default} as default")
logger.info(f"{error} Warning: {message} using {default} as default")
return translation[default] if translation is not None else default

def parse_cords(data, parent, required=False, err_type="Overlay", default=None):
Expand Down

0 comments on commit 5510046

Please sign in to comment.