aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
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 {