mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
Routes: Redirect unknown channel tabs to channel home page
This commit is contained in:
parent
2425c47882
commit
ebee973b24
2 changed files with 7 additions and 1 deletions
|
@ -1,6 +1,12 @@
|
|||
{% skip_file if flag?(:api_only) %}
|
||||
|
||||
module Invidious::Routes::Channels
|
||||
# Redirection for unsupported routes ("tabs")
|
||||
def self.redirect_home(env)
|
||||
ucid = env.params.url["ucid"]
|
||||
return env.redirect "/channel/#{URI.encode_www_form(ucid)}"
|
||||
end
|
||||
|
||||
def self.home(env)
|
||||
self.videos(env)
|
||||
end
|
||||
|
|
|
@ -131,7 +131,7 @@ module Invidious::Routing
|
|||
|
||||
# Channel catch-all, to redirect future routes to the channel's home
|
||||
# NOTE: defined last in order to be processed after the other routes
|
||||
get "/channel/:ucid/*", Routes::Channels, :home
|
||||
get "/channel/:ucid/*", Routes::Channels, :redirect_home
|
||||
|
||||
# /c/LinusTechTips
|
||||
get "/c/:user", Routes::Channels, :brand_redirect
|
||||
|
|
Loading…
Reference in a new issue