From 875b0f98a05d377308c613991132a17585a838d9 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Thu, 12 Sep 2024 20:09:56 -0400 Subject: [PATCH] [scrobblers] Fix manual vidoe lookup and simplify Sports --- vrobbler/apps/scrobbles/scrobblers.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vrobbler/apps/scrobbles/scrobblers.py b/vrobbler/apps/scrobbles/scrobblers.py index 8e6155b..83f56ad 100644 --- a/vrobbler/apps/scrobbles/scrobblers.py +++ b/vrobbler/apps/scrobbles/scrobblers.py @@ -131,7 +131,7 @@ def jellyfin_scrobble_media( def manual_scrobble_video(imdb_id: str, user_id: int): - video = Video.find_or_create({"imdb_id": imdb_id}) + video = Video.find_or_create({JELLYFIN_POST_KEYS.get("IMDB_ID"): imdb_id}) # When manually scrobbling, try finding a source from the series source = "Vrobbler" @@ -161,7 +161,12 @@ def manual_scrobble_event(thesportsdb_id: str, user_id: int): data_dict = lookup_event_from_thesportsdb(thesportsdb_id) event = SportEvent.find_or_create(data_dict) - scrobble_dict = build_scrobble_dict(data_dict, user_id) + scrobble_dict = { + "user_id": user_id, + "timestamp": timezone.now(), + "playback_position_seconds": 0, + "source": "TheSportsDB", + } return Scrobble.create_or_update(event, user_id, scrobble_dict)