mirror of
https://github.com/lutris/lutris
synced 2024-09-15 22:09:55 +00:00
Simplify add_games_bulk
This commit is contained in:
parent
75f84758d9
commit
2ca876dc5f
|
@ -212,17 +212,16 @@ def add_game(name, **game_data):
|
|||
|
||||
|
||||
def add_games_bulk(games):
|
||||
"""Add a list of games to the PGA database.
|
||||
|
||||
The dicts must have an identical set of keys.
|
||||
|
||||
:type games: list of dicts
|
||||
"""
|
||||
inserted_ids = []
|
||||
for game in games:
|
||||
inserted_id = sql.db_insert(PGA_DB, "games", game)
|
||||
inserted_ids.append(inserted_id)
|
||||
return inserted_ids
|
||||
Add a list of games to the PGA database.
|
||||
The dicts must have an identical set of keys.
|
||||
|
||||
Args:
|
||||
games (list): list of games in dict format
|
||||
Returns:
|
||||
list: List of inserted game ids
|
||||
"""
|
||||
return [sql.db_insert(PGA_DB, "games", game) for game in games]
|
||||
|
||||
|
||||
def add_or_update(**params):
|
||||
|
|
Loading…
Reference in a new issue