aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-09-15 21:38:24 +0200
committerdec05eba <dec05eba@protonmail.com>2020-09-15 21:38:24 +0200
commit8d661807e363c973dc6a6d7e6015495e7cc3a2ab (patch)
tree4e39bca0226eae8561dc7e3aceccc5e88776533d /plugins
parentcef36a1f7c90dba57de53de1fa9fd091e304c833 (diff)
Add manga creators page to navigate to others works by the creators
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Manga.hpp11
-rw-r--r--plugins/Manganelo.hpp4
2 files changed, 14 insertions, 1 deletions
diff --git a/plugins/Manga.hpp b/plugins/Manga.hpp
index 18ed2f9..0c57d9f 100644
--- a/plugins/Manga.hpp
+++ b/plugins/Manga.hpp
@@ -8,6 +8,11 @@ namespace QuickMedia {
// Return false to stop iteration
using PageCallback = std::function<bool(const std::string &url)>;
+ struct Creator {
+ std::string name;
+ std::string url;
+ };
+
class Manga : public Plugin {
public:
Manga(const std::string &plugin_name) : Plugin(plugin_name) {}
@@ -15,5 +20,11 @@ namespace QuickMedia {
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;
+
+ virtual PluginResult get_creators_manga_list(const std::string &url, BodyItems &result_items) { return {}; }
+
+ const std::vector<Creator>& get_creators() const;
+ protected:
+ std::vector<Creator> creators;
};
} \ No newline at end of file
diff --git a/plugins/Manganelo.hpp b/plugins/Manganelo.hpp
index ffac830..c2ad693 100644
--- a/plugins/Manganelo.hpp
+++ b/plugins/Manganelo.hpp
@@ -13,12 +13,14 @@ namespace QuickMedia {
ImageResult get_number_of_images(const std::string &url, int &num_images) override;
bool search_suggestions_has_thumbnails() const override { return true; }
bool search_results_has_thumbnails() const override { return false; }
- int get_search_delay() const override { return 150; }
+ int get_search_delay() const override { return 200; }
Page get_page_after_search() const override { return Page::EPISODE_LIST; }
ImageResult for_each_page_in_chapter(const std::string &chapter_url, PageCallback callback) override;
bool extract_id_from_url(const std::string &url, std::string &manga_id) override;
+
+ PluginResult get_creators_manga_list(const std::string &url, BodyItems &result_items) override;
private:
// Caches url. If the same url is requested multiple times then the cache is used
ImageResult get_image_urls_for_chapter(const std::string &url);