Skip to content

Commit

Permalink
Merge pull request #55 from fl0v/patch-1
Browse files Browse the repository at this point in the history
Fix movie lookup by title and year
  • Loading branch information
ghomasHudson authored Dec 1, 2024
2 parents 0733b0a + 0816e3b commit ba25485
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/jellyfin.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def add_item_to_collection(self, collection_id: str, item, year_filter: bool = T
# Check if there's a year match
if match is None and year_filter:
for result in res.json()["Items"]:
if result.get("ProductionYear", None) == item["release_year"]:
if str(result.get("ProductionYear", None)) == str(item["release_year"]):
match = result
break

Expand All @@ -126,7 +126,7 @@ def add_item_to_collection(self, collection_id: str, item, year_filter: bool = T
match = res.json()["Items"][0]

if match is None:
logger.warning(f"Item {item['title']} not found in jellyfin")
logger.warning(f"Item {item['title']} ({item.get('release_year','N/A')}) {item.get('imdb_id','N/A')} not found in jellyfin")
else:
try:
item_id = res.json()["Items"][0]["Id"]
Expand Down

0 comments on commit ba25485

Please sign in to comment.