From 9540ab168be53f3ec2aec513d855df0194d9cb8a Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 29 Oct 2022 21:57:18 +0200 Subject: Matrix: allow opening youtube channel urls from chat --- src/QuickMedia.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 tabs; + auto youtube_channel_page = std::make_unique(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; -- cgit v1.2.3