Skip to content

Commit

Permalink
tools: tu-deck-grabber: fixed setDeckCards for empty deck
Browse files Browse the repository at this point in the history
  • Loading branch information
dsuchka committed Oct 25, 2024
1 parent 1059847 commit bc647e2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tools/tu-deck-grabber.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,10 +646,13 @@ def setDeckCards(self,
card_map = {}
for cid in card_ids:
card_map[cid] = card_map.get(cid, 0) + 1
card_map_texted = '{'
for k, v in card_map.items():
card_map_texted += f'"{k}":"{v}",'
card_map_texted = card_map_texted[:-1] + '}'
if card_map:
card_map_texted = '{'
for k, v in card_map.items():
card_map_texted += f'"{k}":"{v}",'
card_map_texted = card_map_texted[:-1] + '}'
else:
card_map_texted = '{}'
rd = self.__mkRequestData('setDeckCards', {
'deck_id': str(deck_id),
'dominion_id': str(dominion_id),
Expand Down

0 comments on commit bc647e2

Please sign in to comment.