mirror of
https://github.com/ldericher/fftcgtool
synced 2025-01-15 15:02:59 +00:00
elemental decks sorting
This commit is contained in:
parent
c2f0f7f050
commit
9d5412a12c
2 changed files with 7 additions and 6 deletions
|
@ -14,10 +14,6 @@ class Book:
|
|||
def __init__(self, cards: Cards, language: Language, num_threads: int):
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# sort cards by element, then alphabetically
|
||||
# cards.sort(key=lambda x: x[""].name)
|
||||
# cards.sort(key=lambda x: "Multi" if len(x.elements) > 1 else x.elements[0])
|
||||
|
||||
# all card face URLs
|
||||
urls = [
|
||||
("https://fftcg.cdn.sewest.net/images/cards/full/{}_{}.jpg", card.code.long, language.image_suffix)
|
||||
|
|
|
@ -89,7 +89,7 @@ class Opus(Cards):
|
|||
for card in self
|
||||
],
|
||||
f"{self.name}",
|
||||
f"All {self.name} Cards in elemental, then alphabetical order"
|
||||
f"All {self.name} Cards"
|
||||
)]
|
||||
|
||||
else:
|
||||
|
@ -110,10 +110,15 @@ class Opus(Cards):
|
|||
"Multi": lambda card: len(card.elements) > 1,
|
||||
}
|
||||
|
||||
# sort cards by element, then alphabetically
|
||||
cards = list(self)
|
||||
cards.sort(key=lambda x: x[self.__language].name)
|
||||
cards.sort(key=lambda x: "Multi" if len(x.elements) > 1 else x.elements[0])
|
||||
|
||||
return [TTSDeck(
|
||||
[
|
||||
card.code
|
||||
for card in self
|
||||
for card in cards
|
||||
if f(card)
|
||||
],
|
||||
f"{self.name} {elem}",
|
||||
|
|
Loading…
Reference in a new issue