[videos] Fix error where we add tt to the IMDB id

This commit is contained in:
2025-02-02 23:02:44 -05:00
parent 25900a9911
commit 15f27b73a5
2 changed files with 4 additions and 4 deletions

View File

@ -104,7 +104,9 @@ def jellyfin_scrobble_media(
/ 10000000
)
if media_type == Scrobble.MediaType.VIDEO:
media_obj = Video.find_or_create(post_data)
media_obj = Video.get_from_imdb_id(
post_data.get("Provider_imdb", "").replace("tt", "")
)
else:
media_obj = get_or_create_track(
post_data, post_keys=JELLYFIN_POST_KEYS

View File

@ -316,8 +316,6 @@ class Video(ScrobblableMixin):
).as_dict_with_cover_and_genres()
if created or overwrite:
for k, v in vdict.items():
if k == "imdb_id":
v = "tt" + v
setattr(video, k, v)
video.save()
@ -330,5 +328,5 @@ class Video(ScrobblableMixin):
cls, data_dict: dict, post_keys: dict = JELLYFIN_POST_KEYS
) -> Optional["Video"]:
"""Thes smallest of wrappers around our actual get or create utility."""
imdb_key = post_keys.get("IMDB_ID")
imdb_key = post_keys.get("IMDB_ID", "").replace("tt", "")
return cls.get_from_imdb_id(data_dict.get(imdb_key))