Routes: Redirect unknown channel tabs to channel home page

このコミットが含まれているのは:
Samantaz Fox 2023-09-16 00:54:14 +02:00
コミット ebee973b24
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: F42821059186176E
2個のファイルの変更7行の追加1行の削除

ファイルの表示

@ -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