[scrobblers] Fix manual vidoe lookup and simplify Sports

This commit is contained in:
2024-09-12 20:09:56 -04:00
parent 5d1edc71d7
commit 875b0f98a0

View File

@ -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)