mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-21 05:34:22 -05:00
Add new /channel/:ucid/search endpoint
This commit is contained in:
parent
208e61669f
commit
58c4700bde
@ -316,8 +316,9 @@ Invidious::Routing.get "/channel/:ucid/playlists", Invidious::Routes::Channels,
|
|||||||
Invidious::Routing.get "/channel/:ucid/community", Invidious::Routes::Channels, :community
|
Invidious::Routing.get "/channel/:ucid/community", Invidious::Routes::Channels, :community
|
||||||
Invidious::Routing.get "/channel/:ucid/channels", Invidious::Routes::Channels, :channels
|
Invidious::Routing.get "/channel/:ucid/channels", Invidious::Routes::Channels, :channels
|
||||||
Invidious::Routing.get "/channel/:ucid/about", Invidious::Routes::Channels, :about
|
Invidious::Routing.get "/channel/:ucid/about", Invidious::Routes::Channels, :about
|
||||||
|
Invidious::Routing.get "/channel/:ucid/search", Invidious::Routes::Channels, :search
|
||||||
|
|
||||||
["", "/home", "/videos", "/playlists", "/community", "/channels", "/about"].each do |path|
|
["", "/home", "/videos", "/playlists", "/community", "/channels", "/about", "/search"].each do |path|
|
||||||
Invidious::Routing.get "/c/:user#{path}", Invidious::Routes::Channels, :brand_redirect
|
Invidious::Routing.get "/c/:user#{path}", Invidious::Routes::Channels, :brand_redirect
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -194,6 +194,10 @@ class Invidious::Routes::Channels < Invidious::Routes::BaseRoute
|
|||||||
env.redirect url
|
env.redirect url
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def search(env)
|
||||||
|
return env.redirect "/search?#{env.params.query}&channel=#{env.params.url["ucid"]}"
|
||||||
|
end
|
||||||
|
|
||||||
private def fetch_basic_information(env)
|
private def fetch_basic_information(env)
|
||||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user