From 564e7c38ebf860bcb85a401d6ae84d9c78314eaa Mon Sep 17 00:00:00 2001 From: Hazel Noack Date: Tue, 10 Jun 2025 14:23:00 +0200 Subject: [PATCH] feat: added chapter limit --- scribble_to_epub/scribblehub.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scribble_to_epub/scribblehub.py b/scribble_to_epub/scribblehub.py index 6e044c9..076ad56 100644 --- a/scribble_to_epub/scribblehub.py +++ b/scribble_to_epub/scribblehub.py @@ -261,11 +261,13 @@ class ScribbleBook: print(str(self)) self.fetch_chapters(limit=limit_chapters) - for chapter in self.chapters[:limit_chapters if limit_chapters is not None else len(self.chapters)]: + if limit_chapters is not None: + self.chapters = self.chapters[:limit_chapters] + + for chapter in self.chapters: print(str(chapter)) chapter.load() - def load_metadata(self) -> None: """ Load the metadata for this object @@ -350,3 +352,6 @@ class ScribbleBook: self.chapters.append(chapter) self.chapters.sort(key=lambda x: x.index) + + def build(self): + pass