From 6920c99931749f57bef111a4950b42c14ddc6a2b Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Thu, 18 Jan 2024 17:20:20 -0500 Subject: [PATCH] Don't relookup games if we have it already --- vrobbler/apps/scrobbles/scrobblers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vrobbler/apps/scrobbles/scrobblers.py b/vrobbler/apps/scrobbles/scrobblers.py index c472134..e677779 100644 --- a/vrobbler/apps/scrobbles/scrobblers.py +++ b/vrobbler/apps/scrobbles/scrobblers.py @@ -201,8 +201,10 @@ def manual_scrobble_event(thesportsdb_id: str, user_id: int): def manual_scrobble_video_game(hltb_id: str, user_id: int): - data_dict = lookup_game_from_hltb(hltb_id) - game = VideoGame.find_or_create(data_dict) + game = VideoGame.objects.filter(hltb_id=hltb_id).first() + if not game: + data_dict = lookup_game_from_hltb(hltb_id) + game = VideoGame.find_or_create(data_dict) scrobble_dict = { "user_id": user_id,