Fix looking up games by hltb only
This commit is contained in:
@ -45,8 +45,15 @@ def get_or_create_videogame(
|
|||||||
if "genres" in game_dict.keys():
|
if "genres" in game_dict.keys():
|
||||||
genres = game_dict.pop("genres")
|
genres = game_dict.pop("genres")
|
||||||
|
|
||||||
|
hltb_id = game_dict.get("hltb_id")
|
||||||
|
igdb_id = game_dict.get("igdb_id")
|
||||||
|
if hltb_id:
|
||||||
|
game, game_created = VideoGame.objects.get_or_create(hltb_id=hltb_id)
|
||||||
|
elif igdb_id:
|
||||||
|
game, game_created = VideoGame.objects.get_or_create(igdb_id=igdb_id)
|
||||||
|
else:
|
||||||
game, game_created = VideoGame.objects.get_or_create(
|
game, game_created = VideoGame.objects.get_or_create(
|
||||||
hltb_id=game_dict.get("hltb_id")
|
title=game_dict.get("title")
|
||||||
)
|
)
|
||||||
|
|
||||||
if game_created or force_update:
|
if game_created or force_update:
|
||||||
|
|||||||
Reference in New Issue
Block a user