diff --git a/manga.py b/manga.py index b1c8f8d..ede686f 100644 --- a/manga.py +++ b/manga.py @@ -62,6 +62,14 @@ class Manga: print(info) def choose_chapters(self, auto): + if auto: + self.chapters = [ + chapter + for chapter in self.chapters + if chapter.get("nr") not in self.cached + ] + return + choices = [ questionary.Choice( f"{chapter.get('nr'):g}: {chapter.get('title')}", @@ -70,18 +78,9 @@ class Manga: ) for chapter in self.chapters ] - self.chapters = ( - questionary.checkbox("Choose which chapters to download", choices) - .skip_if( - auto, - [ - chapter - for chapter in self.chapters - if chapter.get("nr") not in self.cached - ], - ) - .ask() - ) + self.chapters = questionary.checkbox( + "Choose which chapters to download", choices + ).ask() def download(self, save_dir: Path): series_name = self.info.get('series', 'Unknown')