aboutsummaryrefslogtreecommitdiff
path: root/plugins/MyAnimeList.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-08-16 21:13:24 +0200
committerdec05eba <dec05eba@protonmail.com>2021-08-16 21:13:24 +0200
commit5cc735b22570f1667d62958e59ce4910b529f5af (patch)
tree75128a8926a48a612bc892d266032bd7afd9c2cf /plugins/MyAnimeList.hpp
parentde4825e548b990493b372237cbef9a790bf114c4 (diff)
Add MyAnimeList (wip)
Diffstat (limited to 'plugins/MyAnimeList.hpp')
-rw-r--r--plugins/MyAnimeList.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/MyAnimeList.hpp b/plugins/MyAnimeList.hpp
new file mode 100644
index 0000000..c88e94f
--- /dev/null
+++ b/plugins/MyAnimeList.hpp
@@ -0,0 +1,36 @@
+#pragma once
+
+#include "Page.hpp"
+
+namespace QuickMedia {
+ class MyAnimeListSearchPage : public Page {
+ public:
+ MyAnimeListSearchPage(Program *program) : Page(program) {}
+ const char* get_title() const override { return "Search for anime or manga"; }
+ bool search_is_filter() override { return false; }
+ SearchResult search(const std::string &str, BodyItems &result_items) override;
+ PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override;
+ };
+
+ class MyAnimeListDetailsPage : public LazyFetchPage {
+ public:
+ MyAnimeListDetailsPage(Program *program, std::string url) : LazyFetchPage(program), url(std::move(url)) {}
+ const char* get_title() const override { return "Details"; }
+ bool submit_is_async() const override { return false; }
+ PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override;
+ PluginResult lazy_fetch(BodyItems &result_items) override;
+ private:
+ std::string url;
+ };
+
+ class MyAnimeListRecommendationsPage : public LazyFetchPage {
+ public:
+ MyAnimeListRecommendationsPage(Program *program, std::string url) : LazyFetchPage(program), url(std::move(url)) {}
+ const char* get_title() const override { return "Recommendations"; }
+ bool submit_is_async() const override { return false; }
+ PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override;
+ PluginResult lazy_fetch(BodyItems &result_items) override;
+ private:
+ std::string url;
+ };
+} \ No newline at end of file