diff options
Diffstat (limited to 'src/plugins/Youtube.cpp')
-rw-r--r-- | src/plugins/Youtube.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp index b86112d..d6035f2 100644 --- a/src/plugins/Youtube.cpp +++ b/src/plugins/Youtube.cpp @@ -854,26 +854,26 @@ namespace QuickMedia { return PluginResult::OK; } - PluginResult YoutubeSearchPage::submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) { - if(url.empty()) + PluginResult YoutubeSearchPage::submit(const SubmitArgs &args, std::vector<Tab> &result_tabs) { + if(args.url.empty()) return PluginResult::OK; - if(strncmp(url.c_str(), "https://www.youtube.com/channel/", 32) == 0) { + if(strncmp(args.url.c_str(), "https://www.youtube.com/channel/", 32) == 0) { // TODO: Make all pages (for all services) lazy fetch in a similar manner! - result_tabs.push_back(Tab{create_body(false, true), std::make_unique<YoutubeChannelPage>(program, url, "", title), create_search_bar("Search...", 350)}); + result_tabs.push_back(Tab{create_body(false, true), std::make_unique<YoutubeChannelPage>(program, args.url, "", args.title), create_search_bar("Search...", 350)}); } else { - result_tabs.push_back(Tab{nullptr, std::make_unique<YoutubeVideoPage>(program, url), nullptr}); + result_tabs.push_back(Tab{nullptr, std::make_unique<YoutubeVideoPage>(program, args.url), nullptr}); } return PluginResult::OK; } - PluginResult YoutubeSearchPage::submit_suggestion(const std::string&, const std::string &url, BodyItems &result_items) { + PluginResult YoutubeSearchPage::submit_suggestion(const SubmitArgs &args, BodyItems &result_items) { continuation_token.clear(); current_page = 0; added_videos.clear(); search_url = "https://www.youtube.com/results?search_query="; - search_url += url_param_encode(url); + search_url += url_param_encode(args.url); std::vector<CommandArg> additional_args = { { "-H", "x-spf-referer: " + search_url }, @@ -1003,10 +1003,10 @@ namespace QuickMedia { return PluginResult::OK; } - PluginResult YoutubeCommentsPage::submit(const std::string&, const std::string &url, std::vector<Tab> &result_tabs) { - if(url.empty()) + PluginResult YoutubeCommentsPage::submit(const SubmitArgs &args, std::vector<Tab> &result_tabs) { + if(args.url.empty()) return PluginResult::OK; - result_tabs.push_back(Tab{create_body(), std::make_unique<YoutubeCommentRepliesPage>(program, video_url, url), nullptr}); + result_tabs.push_back(Tab{create_body(), std::make_unique<YoutubeCommentRepliesPage>(program, video_url, args.url), nullptr}); return PluginResult::OK; } @@ -1332,7 +1332,7 @@ namespace QuickMedia { return PluginResult::OK; } - PluginResult YoutubeCommentRepliesPage::submit(const std::string&, const std::string&, std::vector<Tab>&) { + PluginResult YoutubeCommentRepliesPage::submit(const SubmitArgs &args, std::vector<Tab>&) { return PluginResult::OK; } @@ -1531,10 +1531,10 @@ namespace QuickMedia { return PluginResult::OK; } - PluginResult YoutubeChannelPage::submit(const std::string&, const std::string &url, std::vector<Tab> &result_tabs) { - if(url.empty()) + PluginResult YoutubeChannelPage::submit(const SubmitArgs &args, std::vector<Tab> &result_tabs) { + if(args.url.empty()) return PluginResult::OK; - result_tabs.push_back(Tab{nullptr, std::make_unique<YoutubeVideoPage>(program, url), nullptr}); + result_tabs.push_back(Tab{nullptr, std::make_unique<YoutubeVideoPage>(program, args.url), nullptr}); return PluginResult::OK; } @@ -1624,8 +1624,8 @@ namespace QuickMedia { return TrackResult::OK; } - PluginResult YoutubeSubscriptionsPage::submit(const std::string&, const std::string &url, std::vector<Tab> &result_tabs) { - result_tabs.push_back(Tab{nullptr, std::make_unique<YoutubeVideoPage>(program, url), nullptr}); + PluginResult YoutubeSubscriptionsPage::submit(const SubmitArgs &args, std::vector<Tab> &result_tabs) { + result_tabs.push_back(Tab{nullptr, std::make_unique<YoutubeVideoPage>(program, args.url), nullptr}); return PluginResult::OK; } @@ -1863,8 +1863,8 @@ namespace QuickMedia { return PluginResult::OK; } - PluginResult YoutubeRecommendedPage::submit(const std::string&, const std::string &url, std::vector<Tab> &result_tabs) { - result_tabs.push_back(Tab{nullptr, std::make_unique<YoutubeVideoPage>(program, url), nullptr}); + PluginResult YoutubeRecommendedPage::submit(const SubmitArgs &args, std::vector<Tab> &result_tabs) { + result_tabs.push_back(Tab{nullptr, std::make_unique<YoutubeVideoPage>(program, args.url), nullptr}); return PluginResult::OK; } @@ -1959,8 +1959,8 @@ namespace QuickMedia { return PluginResult::OK; } - PluginResult YoutubeRelatedVideosPage::submit(const std::string&, const std::string &url, std::vector<Tab> &result_tabs) { - result_tabs.push_back(Tab{nullptr, std::make_unique<YoutubeVideoPage>(program, url), nullptr}); + PluginResult YoutubeRelatedVideosPage::submit(const SubmitArgs &args, std::vector<Tab> &result_tabs) { + result_tabs.push_back(Tab{nullptr, std::make_unique<YoutubeVideoPage>(program, args.url), nullptr}); return PluginResult::OK; } |