Fixed bug in missing played boardgames from collection
This commit is contained in:
parent
fb5995c88f
commit
dbfc5ba903
1 changed files with 4 additions and 0 deletions
|
|
@ -120,6 +120,10 @@ def get_plays(session: Session) -> list[play_classes.Play]:
|
|||
#Remove None's (played board games don't have expansion id and vice versa)
|
||||
played_boardgame_ids = list(filter(lambda x: x != None, played_boardgame_ids))
|
||||
|
||||
boardgames_in_db, boardgame_ids_missing = db_connection.get_multiple_boardgames(session, boardgame_ids=played_boardgame_ids)
|
||||
missing_boardgames = bgg_connection.get_multiple_boardgames(boardgame_ids_missing)
|
||||
db_connection.upsert_multiple_boardgames(session, missing_boardgames)
|
||||
|
||||
assert len(list(filter(lambda x: x == None, played_boardgame_ids))) == 0, plays_from_db
|
||||
|
||||
return plays_from_db
|
||||
|
|
|
|||
Loading…
Reference in a new issue