diff options
Diffstat (limited to 'plugins/Manga.hpp')
-rw-r--r-- | plugins/Manga.hpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/Manga.hpp b/plugins/Manga.hpp index 60e739b..5dfa800 100644 --- a/plugins/Manga.hpp +++ b/plugins/Manga.hpp @@ -14,27 +14,35 @@ namespace QuickMedia { class MangaImagesPage : public Page { public: - MangaImagesPage(Program *program, std::string manga_name, std::string chapter_name, std::string url) : Page(program), manga_name(std::move(manga_name)), chapter_name(std::move(chapter_name)), url(std::move(url)) {} + MangaImagesPage(Program *program, std::string manga_name, std::string chapter_name, std::string url) : Page(program), manga_name(std::move(manga_name)), chapter_name(std::move(chapter_name)), url(std::move(url)), chapter_num_pages(-1) {} virtual ~MangaImagesPage() = default; const char* get_title() const override { return chapter_name.c_str(); } PageTypez get_type() const override { return PageTypez::MANGA_IMAGES; } - virtual ImageResult get_page_image_urls(std::vector<std::string> &urls) = 0; + virtual ImageResult get_number_of_images(int &num_images) = 0; + virtual ImageResult for_each_page_in_chapter(PageCallback callback) = 0; virtual void change_chapter(std::string new_chapter_name, std::string new_url) { chapter_name = std::move(new_chapter_name); - url = std::move(new_url); + if(url != new_url) { + url = std::move(new_url); + chapter_image_urls.clear(); + chapter_num_pages = -1; + } } const std::string& get_chapter_name() const { return chapter_name; } const std::string& get_url() const { return url; } + // TODO: Remove and use plugin name instead virtual const char* get_service_name() const = 0; const std::string manga_name; protected: std::string chapter_name; std::string url; + std::vector<std::string> chapter_image_urls; + int chapter_num_pages; }; class MangaChaptersPage : public TrackablePage { |