aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-08-17 14:55:10 +0200
committerdec05eba <dec05eba@protonmail.com>2021-08-17 14:55:10 +0200
commitdf95eccc5e8ef62ad9c83a925adc83926491dfb3 (patch)
tree324ce8c2f204f55a4758c93c1110bb4e395159d8 /plugins
parent37e0de2d586099fba5736b13dfb945db5f54fe94 (diff)
AniList: separate anime and manga searches to different tabs
Diffstat (limited to 'plugins')
-rw-r--r--plugins/AniList.hpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/AniList.hpp b/plugins/AniList.hpp
index c877b8e..5fc5eef 100644
--- a/plugins/AniList.hpp
+++ b/plugins/AniList.hpp
@@ -3,10 +3,15 @@
#include "Page.hpp"
namespace QuickMedia {
+ enum class AniListMediaType {
+ ANIME,
+ MANGA
+ };
+
class AniListSearchPage : public Page {
public:
- AniListSearchPage(Program *program) : Page(program) {}
- const char* get_title() const override { return "Search for anime or manga"; }
+ AniListSearchPage(Program *program, AniListMediaType media_type) : Page(program), media_type(media_type) {}
+ const char* get_title() const override { return media_type == AniListMediaType::ANIME ? "Search for anime" : "Search for manga"; }
bool search_is_filter() override { return false; }
bool submit_is_async() const override { return false; }
SearchResult search(const std::string &str, BodyItems &result_items) override;
@@ -14,6 +19,8 @@ namespace QuickMedia {
PluginResult get_page(const std::string &str, int page, BodyItems &result_items) override;
private:
SearchResult search_page(const std::string &str, int page, BodyItems &result_items);
+ private:
+ AniListMediaType media_type;
};
class AniListRelatedPage : public LazyFetchPage {