From b6b972e2dae816a8f0686f4986029a5ed50e592c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 4 Nov 2020 01:30:38 +0100 Subject: Add channels page to related videos menu, fix related videos menu broken after video failing to load --- src/plugins/Pornhub.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/plugins/Pornhub.cpp') diff --git a/src/plugins/Pornhub.cpp b/src/plugins/Pornhub.cpp index f527e76..1f0840e 100644 --- a/src/plugins/Pornhub.cpp +++ b/src/plugins/Pornhub.cpp @@ -138,16 +138,28 @@ namespace QuickMedia { return search_result_to_plugin_result(get_videos_in_page(url, is_tor_enabled(), result_items)); } - PluginResult PornhubSearchPage::submit(const std::string &title, const std::string &url, std::vector &result_tabs) { - (void)title; - (void)url; + PluginResult PornhubSearchPage::submit(const std::string&, const std::string&, std::vector &result_tabs) { result_tabs.push_back(Tab{nullptr, std::make_unique(program), nullptr}); return PluginResult::OK; } - BodyItems PornhubVideoPage::get_related_media(const std::string &url) { + PluginResult PornhubRelatedVideosPage::submit(const std::string&, const std::string&, std::vector &result_tabs) { + result_tabs.push_back(Tab{nullptr, std::make_unique(program), nullptr}); + return PluginResult::OK; + } + + BodyItems PornhubVideoPage::get_related_media(const std::string &url, std::string&) { BodyItems result_items; get_videos_in_page(url, is_tor_enabled(), result_items); return result_items; } + + std::unique_ptr PornhubVideoPage::create_search_page(Program *program, int &search_delay) { + search_delay = 500; + return std::make_unique(program); + } + + std::unique_ptr PornhubVideoPage::create_related_videos_page(Program *program, const std::string&, const std::string&) { + return std::make_unique(program); + } } \ No newline at end of file -- cgit v1.2.3