From cc8f50a2244256a1d619a8064b9e7f8b682a997e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 7 Aug 2019 00:29:38 +0200 Subject: Improve youtube search results --- plugins/Manganelo.hpp | 2 ++ plugins/Plugin.hpp | 2 ++ plugins/Youtube.hpp | 2 ++ 3 files changed, 6 insertions(+) (limited to 'plugins') diff --git a/plugins/Manganelo.hpp b/plugins/Manganelo.hpp index 0f6f421..01311e1 100644 --- a/plugins/Manganelo.hpp +++ b/plugins/Manganelo.hpp @@ -9,6 +9,8 @@ namespace QuickMedia { SuggestionResult update_search_suggestions(const std::string &text, std::vector> &result_items) override; ImageResult get_image_by_index(const std::string &url, int index, std::string &image_data); ImageResult get_number_of_images(const std::string &url, int &num_images); + bool search_suggestions_has_thumbnails() const override { return true; } + bool search_results_has_thumbnails() const override { return true; } private: // Caches url. If the same url is requested multiple times then the cache is used ImageResult get_image_urls_for_chapter(const std::string &url); diff --git a/plugins/Plugin.hpp b/plugins/Plugin.hpp index 6d5a986..3df53ca 100644 --- a/plugins/Plugin.hpp +++ b/plugins/Plugin.hpp @@ -47,6 +47,8 @@ namespace QuickMedia { virtual SearchResult search(const std::string &text, std::vector> &result_items, Page &next_page) = 0; virtual SuggestionResult update_search_suggestions(const std::string &text, std::vector> &result_items); virtual std::vector> get_related_media(const std::string &url); + virtual bool search_suggestions_has_thumbnails() const = 0; + virtual bool search_results_has_thumbnails() const = 0; protected: std::string url_param_encode(const std::string ¶m) const; }; diff --git a/plugins/Youtube.hpp b/plugins/Youtube.hpp index c342a10..25a97c3 100644 --- a/plugins/Youtube.hpp +++ b/plugins/Youtube.hpp @@ -8,5 +8,7 @@ namespace QuickMedia { SearchResult search(const std::string &text, std::vector> &result_items, Page &next_page) override; SuggestionResult update_search_suggestions(const std::string &text, std::vector> &result_items) override; std::vector> get_related_media(const std::string &url) override; + bool search_suggestions_has_thumbnails() const override { return false; } + bool search_results_has_thumbnails() const override { return false; } }; } \ No newline at end of file -- cgit v1.2.3