mirror of
https://github.com/ldericher/fftcgtool
synced 2025-01-15 15:02:59 +00:00
Fix for multi-elements
This commit is contained in:
parent
8208247a74
commit
cc5955865b
4 changed files with 5 additions and 4 deletions
2
card.py
2
card.py
|
@ -27,7 +27,7 @@ class Card:
|
|||
self._serial = data["serial_number"]
|
||||
self._name = data["name"]
|
||||
self._rarity = data["rarity"][0]
|
||||
self._element = data["element"]
|
||||
self._element = data["elements"][0]
|
||||
|
||||
# handle multi element cards
|
||||
if len(data["elements"]) > 1:
|
||||
|
|
File diff suppressed because one or more lines are too long
4
main.py
4
main.py
|
@ -36,7 +36,6 @@ def main():
|
|||
|
||||
# Setup logging
|
||||
logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(threadName)s %(message)s')
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Fetch and parse card database from ffdecks API
|
||||
ffdecks_raw = requests.get(FURL)
|
||||
|
@ -72,7 +71,8 @@ def main():
|
|||
["Ice"],
|
||||
["Wind"],
|
||||
["Earth"],
|
||||
["Light", "Dark"]
|
||||
["Light", "Dark"],
|
||||
["Multi"]
|
||||
]
|
||||
for i, elements in enumerate(elementaldecks):
|
||||
json_filename = "opus_{}_{}.json".format(args.opusid, "_".join(elements))
|
||||
|
|
2
opus.py
2
opus.py
|
@ -47,10 +47,12 @@ class imageLoader(threading.Thread):
|
|||
|
||||
class Opus:
|
||||
def __init__(self, data):
|
||||
logger = logging.getLogger(__name__)
|
||||
self._cards = []
|
||||
|
||||
for card_data in data:
|
||||
card = Card(card_data)
|
||||
logger.info("Imported card {}".format(card))
|
||||
self._cards.append(card)
|
||||
|
||||
# sort every element alphabetically
|
||||
|
|
Loading…
Reference in a new issue