Skip to content

Commit ba25485

Browse files
authored
Merge pull request #55 from fl0v/patch-1
Fix movie lookup by title and year
2 parents 0733b0a + 0816e3b commit ba25485

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils/jellyfin.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def add_item_to_collection(self, collection_id: str, item, year_filter: bool = T
117117
# Check if there's a year match
118118
if match is None and year_filter:
119119
for result in res.json()["Items"]:
120-
if result.get("ProductionYear", None) == item["release_year"]:
120+
if str(result.get("ProductionYear", None)) == str(item["release_year"]):
121121
match = result
122122
break
123123

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

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

0 commit comments

Comments
 (0)