diff --git a/fftcg/book.py b/fftcg/book.py index ed032ae..53b51e0 100644 --- a/fftcg/book.py +++ b/fftcg/book.py @@ -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) diff --git a/fftcg/opus.py b/fftcg/opus.py index af539c5..92ceb91 100644 --- a/fftcg/opus.py +++ b/fftcg/opus.py @@ -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}",