From 27e748dec4792ac8612fb77e21a6d857a41a816c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 3 Oct 2020 09:49:25 +0200 Subject: Nyaa.si: fetch next page when reaching the bottom --- plugins/NyaaSi.hpp | 3 +++ plugins/Plugin.hpp | 9 +++++++++ 2 files changed, 12 insertions(+) (limited to 'plugins') diff --git a/plugins/NyaaSi.hpp b/plugins/NyaaSi.hpp index 428d8b5..97b69e7 100644 --- a/plugins/NyaaSi.hpp +++ b/plugins/NyaaSi.hpp @@ -14,6 +14,7 @@ namespace QuickMedia { ~NyaaSi() override; PluginResult get_front_page(BodyItems &result_items) override; SearchResult content_list_search(const std::string &list_url, const std::string &text, BodyItems &result_items) override; + SearchResult content_list_search_page(const std::string &list_url, const std::string &text, int page, BodyItems &result_items) 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; } @@ -22,5 +23,7 @@ namespace QuickMedia { bool content_list_search_is_filter() const override { return false; } PluginResult get_content_list(const std::string &url, BodyItems &result_items) override; PluginResult get_content_details(const std::string &list_url, const std::string &url, BodyItems &result_items) override; + private: + SearchResult search_page(const std::string &list_url, const std::string &text, int page, BodyItems &result_items); }; } \ No newline at end of file diff --git a/plugins/Plugin.hpp b/plugins/Plugin.hpp index d2caa67..2cc08cc 100644 --- a/plugins/Plugin.hpp +++ b/plugins/Plugin.hpp @@ -53,6 +53,15 @@ namespace QuickMedia { virtual SearchResult search(const std::string &text, BodyItems &result_items); virtual SuggestionResult update_search_suggestions(const std::string &text, BodyItems &result_items); virtual SearchResult content_list_search(const std::string &list_url, const std::string &text, BodyItems &result_items); + // TODO: Merge with above? + // page 0 is the first page + virtual SearchResult content_list_search_page(const std::string &list_url, const std::string &text, int page, BodyItems &result_items) { + (void)list_url; + (void)text; + (void)page; + (void)result_items; + return SearchResult::OK; + } virtual BodyItems get_related_media(const std::string &url); virtual PluginResult get_content_list(const std::string &url, BodyItems &result_items) { (void)url; -- cgit v1.2.3