diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-10-03 09:49:25 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-10-03 09:50:25 +0200 |
commit | 27e748dec4792ac8612fb77e21a6d857a41a816c (patch) | |
tree | 5e6cd561ade545ee91261d73ef5ac9c62e326fd1 /plugins | |
parent | c470174b397c7a81b7510f191e404cb895d462af (diff) |
Nyaa.si: fetch next page when reaching the bottom
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/NyaaSi.hpp | 3 | ||||
-rw-r--r-- | plugins/Plugin.hpp | 9 |
2 files changed, 12 insertions, 0 deletions
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; |