diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-08-09 18:22:43 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-08-09 18:22:43 +0200 |
commit | 44bc399ccbd7e37107ae754db7da3d918229422d (patch) | |
tree | cf989a2699c7638328f292bcde49ed66ac013640 /plugins/Youtube.hpp | |
parent | c2efd1e6587223cf9fff302fbc0ef80fcb4340e2 (diff) |
Youtube: show search suggestions instead of immediate search
Fix save file dialog not showing all files after navigating to another
directory if the search is not empty.
Fix matrix system message deletion reverting back to use message (for
avatar) and text color.
Diffstat (limited to 'plugins/Youtube.hpp')
-rw-r--r-- | plugins/Youtube.hpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/Youtube.hpp b/plugins/Youtube.hpp index 50412de..c7aff93 100644 --- a/plugins/Youtube.hpp +++ b/plugins/Youtube.hpp @@ -30,17 +30,20 @@ namespace QuickMedia { class YoutubeSearchPage : public LazyFetchPage { public: - YoutubeSearchPage(Program *program) : LazyFetchPage(program) {} + YoutubeSearchPage(Program *program, std::string video_id = "") : LazyFetchPage(program), video_id(std::move(video_id)) {} const char* get_title() const override { return "Search"; } + bool search_is_suggestion() override { return true; } bool search_is_filter() override { return false; } SearchResult search(const std::string &str, BodyItems &result_items) override; PluginResult get_page(const std::string &str, int page, BodyItems &result_items) override; PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override; + PluginResult submit_suggestion(const std::string &title, const std::string &url, BodyItems &result_items) override; PluginResult lazy_fetch(BodyItems &result_items) override; bool lazy_fetch_is_loader() override { return true; } private: PluginResult search_get_continuation(const std::string &url, const std::string &continuation_token, BodyItems &result_items); private: + std::string video_id; std::string search_url; std::string continuation_token; int current_page = 0; @@ -138,7 +141,7 @@ namespace QuickMedia { YoutubeVideoPage(Program *program, std::string url); const char* get_title() const override { return ""; } BodyItems get_related_media(const std::string &url) override; - std::unique_ptr<Page> create_search_page(Program *program, int &search_delay) override; + bool create_search_page(Program *program, Tab &tab) override; std::unique_ptr<Page> create_comments_page(Program *program) override; std::unique_ptr<RelatedVideosPage> create_related_videos_page(Program *program) override; std::unique_ptr<Page> create_channels_page(Program *program, const std::string &channel_url) override; |