From acb6ac0a04e800a79876908fd1fdb98dc7e93678 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 13 May 2021 23:30:20 +0200 Subject: Show local time for nyaa.si, soundcloud and spotify. Add sukebei --- plugins/NyaaSi.hpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/NyaaSi.hpp b/plugins/NyaaSi.hpp index 13cc437..45c2f7b 100644 --- a/plugins/NyaaSi.hpp +++ b/plugins/NyaaSi.hpp @@ -3,18 +3,22 @@ #include "Page.hpp" namespace QuickMedia { + void get_nyaa_si_categories(BodyItems &result_items); + void get_sukebei_categories(BodyItems &result_items); + class NyaaSiCategoryPage : public Page { public: - NyaaSiCategoryPage(Program *program) : Page(program) {} - const char* get_title() const override { return "Select category"; } + NyaaSiCategoryPage(Program *program, bool is_sukebei) : Page(program), is_sukebei(is_sukebei) {} + const char* get_title() const override { return is_sukebei ? "Select sukebei category" : "Select nyaa.si category"; } PluginResult submit(const std::string &title, const std::string &url, std::vector &result_tabs) override; bool clear_search_after_submit() override { return true; } - void get_categories(BodyItems &result_items); + + const bool is_sukebei; }; class NyaaSiSearchPage : public Page { public: - NyaaSiSearchPage(Program *program, std::string category_name, std::string category_id) : Page(program), category_name(std::move(category_name)), category_id(std::move(category_id)) {} + NyaaSiSearchPage(Program *program, std::string category_name, std::string category_id, std::string domain) : Page(program), category_name(std::move(category_name)), category_id(std::move(category_id)), domain(std::move(domain)) {} const char* get_title() const override { return category_name.c_str(); } bool search_is_filter() override { return false; } SearchResult search(const std::string &str, BodyItems &result_items) override; @@ -23,6 +27,7 @@ namespace QuickMedia { const std::string category_name; const std::string category_id; + const std::string domain; }; class NyaaSiTorrentPage : public Page { -- cgit v1.2.3