[boardgames] Add comments and bgstats_id to scrobbles
This commit is contained in:
@ -321,13 +321,16 @@ def find_and_enrich_board_game_data(game_dict: dict) -> BoardGame | None:
|
||||
game.highest_wins = game_dict.get("highestWins", True)
|
||||
game.no_points = game_dict.get("noPoints", False)
|
||||
game.uses_teams = game_dict.get("useTeams", False)
|
||||
game.bgstats_id = game_dict.get("uuid", None)
|
||||
if not game.rating:
|
||||
game.rating = game_dict.get("rating") / 10
|
||||
game.save()
|
||||
|
||||
if game_dict.get("designers"):
|
||||
for designer_name in game_dict.get("designers", "").split(", "):
|
||||
designer, created = BoardGameDesigner.objects.get_or_create(name=designer_name)
|
||||
designer, created = BoardGameDesigner.objects.get_or_create(
|
||||
name=designer_name
|
||||
)
|
||||
game.designers.add(designer.id)
|
||||
return game
|
||||
|
||||
@ -389,6 +392,8 @@ def email_scrobble_board_game(
|
||||
|
||||
scrobbles_created = []
|
||||
for play_dict in bgstat_data.get("plays", []):
|
||||
if "comments" in play_dict.keys():
|
||||
log_data["details"] = play_dict.get("comments")
|
||||
log_data["expansion_ids"] = []
|
||||
try:
|
||||
base_game = base_games[play_dict.get("gameRefId")]
|
||||
|
||||
Reference in New Issue
Block a user