diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-10-19 03:12:31 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-10-19 03:12:31 +0200 |
commit | fd4e8cdc9449dbb0224a1a41ef0561f50012d405 (patch) | |
tree | ae9b2f29c0a7cf1f64a28d6898350fc7bddb718a /plugins | |
parent | 5c1b4fb3198ec398e8b292effe5ca84d280939f3 (diff) |
Add pagination to ph and mangatown
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Mangatown.hpp | 1 | ||||
-rw-r--r-- | plugins/Page.hpp | 1 | ||||
-rw-r--r-- | plugins/Plugin.hpp | 1 | ||||
-rw-r--r-- | plugins/Pornhub.hpp | 1 |
4 files changed, 4 insertions, 0 deletions
diff --git a/plugins/Mangatown.hpp b/plugins/Mangatown.hpp index c85b5b7..151b4c2 100644 --- a/plugins/Mangatown.hpp +++ b/plugins/Mangatown.hpp @@ -10,6 +10,7 @@ namespace QuickMedia { const char* get_title() const override { return "All"; } bool search_is_filter() override { return false; } SearchResult search(const std::string &str, BodyItems &result_items) override; + PluginResult get_page(const std::string &str, int page, BodyItems &result_items) override; PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override; private: bool extract_id_from_url(const std::string &url, std::string &manga_id) const; diff --git a/plugins/Page.hpp b/plugins/Page.hpp index 947f045..2adce85 100644 --- a/plugins/Page.hpp +++ b/plugins/Page.hpp @@ -21,6 +21,7 @@ namespace QuickMedia { // Return empty |result_tabs| and PluginResult::OK to do nothing; which is useful for implementing custom actions on item submit virtual PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) = 0; + // Note: If pagination is done by fetching the next page until we get to |page|, then the "current page" should be reset everytime |search| is called virtual PluginResult get_page(const std::string &str, int page, BodyItems &result_items) { (void)str; (void)page; (void)result_items; return PluginResult::OK; } virtual BodyItems get_related_media(const std::string &url); diff --git a/plugins/Plugin.hpp b/plugins/Plugin.hpp index d754445..2026319 100644 --- a/plugins/Plugin.hpp +++ b/plugins/Plugin.hpp @@ -39,4 +39,5 @@ namespace QuickMedia { PluginResult download_result_to_plugin_result(DownloadResult download_result); SearchResult download_result_to_search_result(DownloadResult download_result); ImageResult download_result_to_image_result(DownloadResult download_result); + PluginResult search_result_to_plugin_result(SearchResult search_result); }
\ No newline at end of file diff --git a/plugins/Pornhub.hpp b/plugins/Pornhub.hpp index 195845f..b058bbe 100644 --- a/plugins/Pornhub.hpp +++ b/plugins/Pornhub.hpp @@ -9,6 +9,7 @@ namespace QuickMedia { const char* get_title() const override { return "All"; } bool search_is_filter() override { return false; } SearchResult search(const std::string &str, BodyItems &result_items) override; + PluginResult get_page(const std::string &str, int page, BodyItems &result_items) override; PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override; }; |