aboutsummaryrefslogtreecommitdiff
path: root/plugins/NyaaSi.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-01-17 19:05:15 +0100
committerdec05eba <dec05eba@protonmail.com>2023-01-17 19:05:15 +0100
commitd203aba86d89c8dd6184146454396e48d39a8fb5 (patch)
tree584fa3856ca7ab534a111f43e0fc93564116a8d9 /plugins/NyaaSi.hpp
parent454f09ac14a76a46335eed60d4e242c446ae28be (diff)
NyaaSi: add ctrl+t to track anime with automedia
Diffstat (limited to 'plugins/NyaaSi.hpp')
-rw-r--r--plugins/NyaaSi.hpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/NyaaSi.hpp b/plugins/NyaaSi.hpp
index 3236fc5..103fea7 100644
--- a/plugins/NyaaSi.hpp
+++ b/plugins/NyaaSi.hpp
@@ -29,7 +29,7 @@ namespace QuickMedia {
DOWNLOADS_ASC
};
- class NyaaSiSearchPage : public Page {
+ class NyaaSiSearchPage : public Page, public TrackablePage {
public:
NyaaSiSearchPage(Program *program, std::string category_name, std::string category_id, std::string domain);
const char* get_title() const override { return title.c_str(); }
@@ -38,6 +38,9 @@ namespace QuickMedia {
PluginResult get_page(const std::string &str, int page, BodyItems &result_items) override;
PluginResult submit(const SubmitArgs &args, std::vector<Tab> &result_tabs) override;
+ TrackResult track(const std::string &str) override;
+ bool is_trackable() const override { return true; }
+
void set_sort_type(NyaaSiSortType sort_type);
const std::string category_name;
@@ -59,11 +62,14 @@ namespace QuickMedia {
NyaaSiSearchPage *search_page;
};
- class NyaaSiTorrentPage : public Page {
+ class NyaaSiTorrentPage : public Page, public TrackablePage {
public:
- NyaaSiTorrentPage(Program *program) : Page(program) {}
- const char* get_title() const override { return "Torrent"; }
+ NyaaSiTorrentPage(Program *program, std::string title) : Page(program), TrackablePage(std::move(title), "") {}
+ const char* get_title() const override { return content_title.c_str(); }
PluginResult submit(const SubmitArgs &args, std::vector<Tab> &result_tabs) override;
bool submit_is_async() const override { return false; }
+
+ TrackResult track(const std::string &str) override;
+ bool is_trackable() const override { return true; }
};
} \ No newline at end of file