From 5cc735b22570f1667d62958e59ce4910b529f5af Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 16 Aug 2021 21:13:24 +0200 Subject: Add MyAnimeList (wip) --- plugins/MyAnimeList.hpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 plugins/MyAnimeList.hpp (limited to 'plugins/MyAnimeList.hpp') 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 &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 &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 &result_tabs) override; + PluginResult lazy_fetch(BodyItems &result_items) override; + private: + std::string url; + }; +} \ No newline at end of file -- cgit v1.2.3