Invidious is an alternative front-end to YouTube
Channels: Fix community tab
Fijxud70681538aca
diff --git a/locales/en-US.json b/locales/en-US.jsonindex c23f6bc3..5f99c1ef 100644--- a/locales/en-US.json+++ b/locales/en-US.json@@ -494,6 +494,7 @@"channel_tab_releases_label": "Releases","channel_tab_playlists_label": "Playlists","channel_tab_community_label": "Community",+ "channel_tab_posts_label": "Posts","channel_tab_channels_label": "Channels","toggle_theme": "Toggle Theme","carousel_slide": "Slide {{current}} of {{total}}",diff --git a/src/invidious/frontend/channel_page.cr b/src/invidious/frontend/channel_page.crindex fe7d6d6e..00f24568 100644--- a/src/invidious/frontend/channel_page.cr+++ b/src/invidious/frontend/channel_page.cr@@ -8,7 +8,7 @@ module Invidious::Frontend::ChannelPagePodcastsReleasesPlaylists- Community+ PostsChannelsenddiff --git a/src/invidious/routes/channels.cr b/src/invidious/routes/channels.crindex 7d634cbb..65e794bd 100644--- a/src/invidious/routes/channels.cr+++ b/src/invidious/routes/channels.cr@@ -198,6 +198,8 @@ module Invidious::Routes::Channelsenddef self.community(env)+ return env.redirect env.request.path.sub("posts", "community") if env.request.path.split("/").last == "posts"+data = self.fetch_basic_information(env)if !data.is_a?(Tuple)return data@@ -214,7 +216,7 @@ module Invidious::Routes::Channelscontinuation = env.params.query["continuation"]?- if !channel.tabs.includes? "community"+ if !channel.tabs.includes? "community" && "posts"return env.redirect "/channel/#{channel.ucid}"end@@ -308,6 +310,7 @@ module Invidious::Routes::Channelsprivate KNOWN_TABS = {"home", "videos", "shorts", "streams", "podcasts","releases", "playlists", "community", "channels", "about",+ "posts",}# Redirects brand url channels to a normal /channel/:ucid routediff --git a/src/invidious/routing.cr b/src/invidious/routing.crindex 9009062f..975659eb 100644--- a/src/invidious/routing.cr+++ b/src/invidious/routing.cr@@ -122,6 +122,7 @@ module Invidious::Routingget "/channel/:ucid/releases", Routes::Channels, :releasesget "/channel/:ucid/playlists", Routes::Channels, :playlistsget "/channel/:ucid/community", Routes::Channels, :community+ get "/channel/:ucid/posts", Routes::Channels, :communityget "/channel/:ucid/channels", Routes::Channels, :channelsget "/channel/:ucid/about", Routes::Channels, :about@@ -251,6 +252,7 @@ module Invidious::Routingget "/api/v1/channels/:ucid/releases", {{namespace}}::Channels, :releasesget "/api/v1/channels/:ucid/playlists", {{namespace}}::Channels, :playlistsget "/api/v1/channels/:ucid/community", {{namespace}}::Channels, :community+ get "/api/v1/channels/:ucid/posts", {{namespace}}::Channels, :communityget "/api/v1/channels/:ucid/channels", {{namespace}}::Channels, :channelsget "/api/v1/channels/:ucid/search", {{namespace}}::Channels, :searchdiff --git a/src/invidious/views/community.ecr b/src/invidious/views/community.ecrindex d2a305d3..132e636c 100644--- a/src/invidious/views/community.ecr+++ b/src/invidious/views/community.ecr@@ -7,7 +7,7 @@youtube_url = "https://www.youtube.com#{relative_url}"redirect_url = Invidious::Frontend::Misc.redirect_url(env)- selected_tab = Invidious::Frontend::ChannelPage::TabsAvailable::Community+ selected_tab = Invidious::Frontend::ChannelPage::TabsAvailable::Posts-%><% content_for "header" do %>