Channels: Fix community tab
All checks were successful
Invidious CI / build (push) Successful in 5m28s
All checks were successful
Invidious CI / build (push) Successful in 5m28s
This commit is contained in:
parent
bb22808b68
commit
7059c7ad24
5 changed files with 9 additions and 3 deletions
|
@ -514,6 +514,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}}",
|
||||
|
|
|
@ -8,7 +8,7 @@ module Invidious::Frontend::ChannelPage
|
|||
Podcasts
|
||||
Releases
|
||||
Playlists
|
||||
Community
|
||||
Posts
|
||||
Channels
|
||||
end
|
||||
|
||||
|
|
|
@ -198,6 +198,8 @@ module Invidious::Routes::Channels
|
|||
end
|
||||
|
||||
def 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::Channels
|
|||
|
||||
continuation = 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::Channels
|
|||
private KNOWN_TABS = {
|
||||
"home", "videos", "shorts", "streams", "podcasts",
|
||||
"releases", "playlists", "community", "channels", "about",
|
||||
"posts",
|
||||
}
|
||||
|
||||
# Redirects brand url channels to a normal /channel/:ucid route
|
||||
|
|
|
@ -122,6 +122,7 @@ module Invidious::Routing
|
|||
get "/channel/:ucid/releases", Routes::Channels, :releases
|
||||
get "/channel/:ucid/playlists", Routes::Channels, :playlists
|
||||
get "/channel/:ucid/community", Routes::Channels, :community
|
||||
get "/channel/:ucid/posts", Routes::Channels, :community
|
||||
get "/channel/:ucid/channels", Routes::Channels, :channels
|
||||
get "/channel/:ucid/about", Routes::Channels, :about
|
||||
|
||||
|
@ -251,6 +252,7 @@ module Invidious::Routing
|
|||
get "/api/v1/channels/:ucid/releases", {{namespace}}::Channels, :releases
|
||||
get "/api/v1/channels/:ucid/playlists", {{namespace}}::Channels, :playlists
|
||||
get "/api/v1/channels/:ucid/community", {{namespace}}::Channels, :community
|
||||
get "/api/v1/channels/:ucid/posts", {{namespace}}::Channels, :community
|
||||
get "/api/v1/channels/:ucid/channels", {{namespace}}::Channels, :channels
|
||||
get "/api/v1/channels/:ucid/search", {{namespace}}::Channels, :search
|
||||
|
||||
|
|
|
@ -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 %>
|
||||
|
|
Loading…
Add table
Reference in a new issue