diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/NyaaSi.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/plugins/NyaaSi.cpp b/src/plugins/NyaaSi.cpp index 98c6eee..1cdfc5f 100644 --- a/src/plugins/NyaaSi.cpp +++ b/src/plugins/NyaaSi.cpp @@ -71,10 +71,19 @@ namespace QuickMedia { return PluginResult::OK; } + + SearchResult NyaaSi::content_list_search(const std::string &list_url, const std::string &text, BodyItems &result_items) { + return search_page(list_url, text, 1, result_items); + } + + SearchResult NyaaSi::content_list_search_page(const std::string &list_url, const std::string &text, int page, BodyItems &result_items) { + return search_page(list_url, text, 1 + page, result_items); + } + // TODO: Also show the number of comments for each torrent. TODO: Optimize? // TODO: Show each field as seperate columns instead of seperating by | - SearchResult NyaaSi::content_list_search(const std::string &list_url, const std::string &text, BodyItems &result_items) { - std::string full_url = "https://nyaa.si/?c=" + list_url + "&f=0&p=1&q="; + SearchResult NyaaSi::search_page(const std::string &list_url, const std::string &text, int page, BodyItems &result_items) { + std::string full_url = "https://nyaa.si/?c=" + list_url + "&f=0&p=" + std::to_string(page) + "&q="; full_url += url_param_encode(text); std::string website_data; @@ -218,7 +227,7 @@ namespace QuickMedia { } PluginResult NyaaSi::get_content_list(const std::string &url, BodyItems &result_items) { - return search_result_to_plugin_result(content_list_search(url, "", result_items)); + return search_result_to_plugin_result(search_page(url, "", 1, result_items)); } struct BodyItemImageContext { |