aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-10-29 21:57:18 +0200
committerdec05eba <dec05eba@protonmail.com>2022-10-29 21:57:18 +0200
commit9540ab168be53f3ec2aec513d855df0194d9cb8a (patch)
treedb541c751391a16ff37d20472259b164d91adf36
parent9c1d43e772efb8f5af4b7ef5562fb433c8985697 (diff)
Matrix: allow opening youtube channel urls from chat
-rw-r--r--src/QuickMedia.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 69ac66e..44b1315 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -6441,8 +6441,17 @@ namespace QuickMedia {
url = invidious_url_to_youtube_url(url);
+ std::string youtube_channel_id;
+ std::string youtube_channel_url;
std::string video_id;
- if(youtube_url_extract_id(url, video_id)) {
+ if(youtube_url_extract_channel_id(url, youtube_channel_id, youtube_channel_url)) {
+ std::vector<Tab> tabs;
+ auto youtube_channel_page = std::make_unique<YoutubeChannelPage>(this, youtube_channel_url, "", "Channel videos");
+ tabs.push_back(Tab{create_body(false, true), std::move(youtube_channel_page), create_search_bar("Search...", 350)});
+ page_loop(tabs);
+ redraw = true;
+ avatar_applied = false;
+ } else if(youtube_url_extract_id(url, video_id)) {
watched_videos.clear();
page_stack.push(PageType::CHAT);
current_page = PageType::VIDEO_CONTENT;