aboutsummaryrefslogtreecommitdiff
path: root/plugins
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
parent454f09ac14a76a46335eed60d4e242c446ae28be (diff)
NyaaSi: add ctrl+t to track anime with automedia
Diffstat (limited to 'plugins')
-rw-r--r--plugins/NyaaSi.hpp14
-rw-r--r--plugins/utils/EpisodeNameParser.hpp9
2 files changed, 15 insertions, 8 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
diff --git a/plugins/utils/EpisodeNameParser.hpp b/plugins/utils/EpisodeNameParser.hpp
index 1ec847a..7976cdc 100644
--- a/plugins/utils/EpisodeNameParser.hpp
+++ b/plugins/utils/EpisodeNameParser.hpp
@@ -5,10 +5,11 @@
namespace QuickMedia {
struct EpisodeNameParts {
- std::string_view group; // optional
- std::string_view anime; // required
- std::string_view season; // optional
- std::string_view episode; // required
+ std::string_view group; // optional
+ std::string_view anime; // required
+ std::string_view season; // optional
+ std::string_view episode; // required
+ std::string_view resolution; // optional
};
std::optional<EpisodeNameParts> episode_name_extract_parts(std::string_view episode_name);