From df95eccc5e8ef62ad9c83a925adc83926491dfb3 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 17 Aug 2021 14:55:10 +0200 Subject: AniList: separate anime and manga searches to different tabs --- plugins/AniList.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'plugins') 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 { -- cgit v1.2.3