diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Manganelo.hpp | 8 | ||||
-rw-r--r-- | plugins/Plugin.hpp | 10 | ||||
-rw-r--r-- | plugins/Youtube.hpp | 2 |
3 files changed, 17 insertions, 3 deletions
diff --git a/plugins/Manganelo.hpp b/plugins/Manganelo.hpp index 4ed976f..5e9382e 100644 --- a/plugins/Manganelo.hpp +++ b/plugins/Manganelo.hpp @@ -5,7 +5,13 @@ namespace QuickMedia { class Manganelo : public Plugin { public: - SearchResult search(const std::string &text, std::vector<std::unique_ptr<BodyItem>> &result_items) override; + SearchResult search(const std::string &url, std::vector<std::unique_ptr<BodyItem>> &result_items, Page &next_page) override; SuggestionResult update_search_suggestions(const std::string &text, std::vector<std::unique_ptr<BodyItem>> &result_items) override; + ImageResult get_image_by_index(const std::string &url, int index, std::string &image_data); + private: + ImageResult get_image_urls_for_chapter(const std::string &url, std::vector<std::string> &urls); + private: + std::string last_chapter_url; + std::vector<std::string> last_chapter_image_urls; }; }
\ No newline at end of file diff --git a/plugins/Plugin.hpp b/plugins/Plugin.hpp index 09ce09a..818cc5f 100644 --- a/plugins/Plugin.hpp +++ b/plugins/Plugin.hpp @@ -1,5 +1,6 @@ #pragma once +#include "../include/Page.hpp" #include <string> #include <vector> #include <memory> @@ -35,6 +36,13 @@ namespace QuickMedia { NET_ERR }; + enum class ImageResult { + OK, + END, + ERR, + NET_ERR + }; + struct CommandArg { std::string option; std::string value; @@ -44,7 +52,7 @@ namespace QuickMedia { public: virtual ~Plugin() = default; - virtual SearchResult search(const std::string &text, std::vector<std::unique_ptr<BodyItem>> &result_items) = 0; + virtual SearchResult search(const std::string &text, std::vector<std::unique_ptr<BodyItem>> &result_items, Page &next_page) = 0; virtual SuggestionResult update_search_suggestions(const std::string &text, std::vector<std::unique_ptr<BodyItem>> &result_items); virtual std::vector<std::unique_ptr<BodyItem>> get_related_media(const std::string &url); protected: diff --git a/plugins/Youtube.hpp b/plugins/Youtube.hpp index eda8a1f..c342a10 100644 --- a/plugins/Youtube.hpp +++ b/plugins/Youtube.hpp @@ -5,7 +5,7 @@ namespace QuickMedia { class Youtube : public Plugin { public: - SearchResult search(const std::string &text, std::vector<std::unique_ptr<BodyItem>> &result_items) override; + SearchResult search(const std::string &text, std::vector<std::unique_ptr<BodyItem>> &result_items, Page &next_page) override; SuggestionResult update_search_suggestions(const std::string &text, std::vector<std::unique_ptr<BodyItem>> &result_items) override; std::vector<std::unique_ptr<BodyItem>> get_related_media(const std::string &url) override; }; |