diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-05-28 02:08:40 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-05-28 02:08:40 +0200 |
commit | 9799803529c57930a0e7f12e45cbcf2b2e4419eb (patch) | |
tree | b2c488b49d901e5bc5e911a2e714a6748f37158e /plugins/Manga.hpp | |
parent | 217101c7a79dccf8617a7d3251d4b06bc7cb5905 (diff) |
Add support for mangadex
Diffstat (limited to 'plugins/Manga.hpp')
-rw-r--r-- | plugins/Manga.hpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/Manga.hpp b/plugins/Manga.hpp new file mode 100644 index 0000000..18ed2f9 --- /dev/null +++ b/plugins/Manga.hpp @@ -0,0 +1,19 @@ +#pragma once + +#include "Plugin.hpp" +#include <functional> +#include <mutex> + +namespace QuickMedia { + // Return false to stop iteration + using PageCallback = std::function<bool(const std::string &url)>; + + class Manga : public Plugin { + public: + Manga(const std::string &plugin_name) : Plugin(plugin_name) {} + bool is_manga() override { return true; } + virtual ImageResult get_number_of_images(const std::string &url, int &num_images) = 0; + virtual ImageResult for_each_page_in_chapter(const std::string &chapter_url, PageCallback callback) = 0; + virtual bool extract_id_from_url(const std::string &url, std::string &manga_id) = 0; + }; +}
\ No newline at end of file |