aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-02-13 19:19:31 +0100
committerdec05eba <dec05eba@protonmail.com>2022-02-13 19:19:31 +0100
commite65d0b4effdbbcc9393c58075c010f59231fd45e (patch)
tree326adbee3f4387c06892dc1a448b5dc4244d54ca /plugins
parent15708005417840782f7cafeee99d50fc112d49f6 (diff)
Make manga images pages less error prone
Diffstat (limited to 'plugins')
-rw-r--r--plugins/LocalManga.hpp4
-rw-r--r--plugins/Manga.hpp2
-rw-r--r--plugins/MangaGeneric.hpp2
-rw-r--r--plugins/Mangadex.hpp4
-rw-r--r--plugins/Manganelo.hpp4
5 files changed, 5 insertions, 11 deletions
diff --git a/plugins/LocalManga.hpp b/plugins/LocalManga.hpp
index 0ab3f62..d327629 100644
--- a/plugins/LocalManga.hpp
+++ b/plugins/LocalManga.hpp
@@ -53,12 +53,10 @@ namespace QuickMedia {
public:
LocalMangaImagesPage(Program *program, std::string manga_name, std::string chapter_name, std::string url, std::string thumbnail_url) :
MangaImagesPage(program, std::move(manga_name), std::move(chapter_name), std::move(url), std::move(thumbnail_url)) {}
- ImageResult get_number_of_images(int &num_images) override;
+ ImageResult update_image_urls(int &num_images) override;
ImageResult for_each_page_in_chapter(PageCallback callback) override;
const char* get_service_name() const override { return "local-manga"; }
const char* get_website_url() const override { return "localhost"; }
bool is_local() override { return true; }
- private:
- ImageResult get_image_urls_for_chapter(const std::string &url);
};
} \ No newline at end of file
diff --git a/plugins/Manga.hpp b/plugins/Manga.hpp
index fe9f0b4..a05dd3a 100644
--- a/plugins/Manga.hpp
+++ b/plugins/Manga.hpp
@@ -26,7 +26,7 @@ namespace QuickMedia {
const char* get_title() const override { return chapter_name.c_str(); }
PageTypez get_type() const override { return PageTypez::MANGA_IMAGES; }
- virtual ImageResult get_number_of_images(int &num_images) = 0;
+ virtual ImageResult update_image_urls(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) {
diff --git a/plugins/MangaGeneric.hpp b/plugins/MangaGeneric.hpp
index 56d7c74..5318e63 100644
--- a/plugins/MangaGeneric.hpp
+++ b/plugins/MangaGeneric.hpp
@@ -185,7 +185,7 @@ namespace QuickMedia {
public:
MangaGenericImagesPage(Program *program, std::string manga_name, std::string chapter_name, std::string url, const char *service_name, const std::string &website_url, const ListPageQuery *list_page_query, bool fail_on_http_error, std::string thumbnail_url) :
MangaImagesPage(program, std::move(manga_name), std::move(chapter_name), std::move(url), std::move(thumbnail_url)), service_name(service_name), website_url(website_url), list_page_query(list_page_query), fail_on_http_error(fail_on_http_error) {}
- ImageResult get_number_of_images(int &num_images) override;
+ virtual ImageResult update_image_urls(int &num_images) override;
ImageResult for_each_page_in_chapter(PageCallback callback) override;
const char* get_service_name() const override { return service_name; }
const char* get_website_url() const override { return website_url.c_str(); }
diff --git a/plugins/Mangadex.hpp b/plugins/Mangadex.hpp
index 8735326..6153187 100644
--- a/plugins/Mangadex.hpp
+++ b/plugins/Mangadex.hpp
@@ -53,13 +53,11 @@ namespace QuickMedia {
public:
MangadexImagesPage(Program *program, MangadexSearchPage *search_page, std::string manga_name, std::string chapter_id, std::string chapter_name, std::string thumbnail_url) :
MangaImagesPage(program, std::move(manga_name), std::move(chapter_name), std::move(chapter_id), std::move(thumbnail_url)), search_page(search_page) {}
- ImageResult get_number_of_images(int &num_images) override;
+ ImageResult update_image_urls(int &num_images) override;
ImageResult for_each_page_in_chapter(PageCallback callback) override;
const char* get_service_name() const override { return "mangadex"; }
const char* get_website_url() const override { return "https://mangadex.org/"; }
private:
- ImageResult get_image_urls_for_chapter(const std::string &url);
- private:
MangadexSearchPage *search_page;
};
} \ No newline at end of file
diff --git a/plugins/Manganelo.hpp b/plugins/Manganelo.hpp
index d835a06..f44ad2d 100644
--- a/plugins/Manganelo.hpp
+++ b/plugins/Manganelo.hpp
@@ -37,11 +37,9 @@ namespace QuickMedia {
public:
ManganeloImagesPage(Program *program, std::string manga_name, std::string chapter_name, std::string url, std::string thumbnail_url) :
MangaImagesPage(program, std::move(manga_name), std::move(chapter_name), std::move(url), std::move(thumbnail_url)) {}
- ImageResult get_number_of_images(int &num_images) override;
+ ImageResult update_image_urls(int &num_images) override;
ImageResult for_each_page_in_chapter(PageCallback callback) override;
const char* get_service_name() const override { return "manganelo"; }
const char* get_website_url() const override { return "https://manganelo.com/"; }
- private:
- ImageResult get_image_urls_for_chapter(const std::string &url);
};
} \ No newline at end of file