diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-07-03 16:55:19 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-03 16:55:19 +0200 |
commit | 18467b4cd333ab0b7aa10b1c1acd83942c583e60 (patch) | |
tree | beb77bd217a9530bd2ed057f67a5412ba3f8a1e3 /plugins | |
parent | 2d796243ad157f52d33a5b9d4f449e3845cf1649 (diff) |
Add tab autocomplete for youtube
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Plugin.hpp | 2 | ||||
-rw-r--r-- | plugins/Youtube.hpp | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/plugins/Plugin.hpp b/plugins/Plugin.hpp index be70684..54ce67d 100644 --- a/plugins/Plugin.hpp +++ b/plugins/Plugin.hpp @@ -65,6 +65,8 @@ namespace QuickMedia { } virtual bool search_suggestions_has_thumbnails() const = 0; virtual bool search_results_has_thumbnails() const = 0; + virtual std::string autocomplete_search(const std::string &query) { return query; } + virtual int get_autocomplete_delay() const { return 100; } virtual int get_search_delay() const = 0; virtual bool search_suggestion_is_search() const { return false; } virtual Page get_page_after_search() const = 0; diff --git a/plugins/Youtube.hpp b/plugins/Youtube.hpp index 2eea8c2..5a88970 100644 --- a/plugins/Youtube.hpp +++ b/plugins/Youtube.hpp @@ -10,13 +10,13 @@ namespace QuickMedia { BodyItems get_related_media(const std::string &url) override; bool search_suggestions_has_thumbnails() const override { return true; } bool search_results_has_thumbnails() const override { return false; } + std::string autocomplete_search(const std::string &query) override; int get_search_delay() const override { return 350; } bool search_suggestion_is_search() const override { return true; } Page get_page_after_search() const override { return Page::VIDEO_CONTENT; } private: void search_suggestions_get_continuation(const std::string &url, const std::string &continuation_token, BodyItems &result_items); private: - std::string last_related_media_playlist_id; - BodyItems last_playlist_data; + std::string last_autocomplete_result; }; }
\ No newline at end of file |