routing: move image proxy routes registration to Invidious::Routing

pull/3261/head
Samantaz Fox 2022-08-10 00:20:04 +02:00
rodzic 3ac4390d11
commit e2532de766
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: F42821059186176E
2 zmienionych plików z 10 dodań i 6 usunięć

Wyświetl plik

@ -393,12 +393,7 @@ end
Invidious::Routing.get "/modify_notifications", Invidious::Routes::Notifications, :modify
{% end %}
Invidious::Routing.get "/ggpht/*", Invidious::Routes::Images, :ggpht
Invidious::Routing.options "/sb/:authority/:id/:storyboard/:index", Invidious::Routes::Images, :options_storyboard
Invidious::Routing.get "/sb/:authority/:id/:storyboard/:index", Invidious::Routes::Images, :get_storyboard
Invidious::Routing.get "/s_p/:id/:name", Invidious::Routes::Images, :s_p_image
Invidious::Routing.get "/yts/img/:name", Invidious::Routes::Images, :yts_image
Invidious::Routing.get "/vi/:id/:name", Invidious::Routes::Images, :thumbnails
Invidious::Routing.register_image_routes
# API routes (macro)
Invidious::Routing.register_api_v1_routes

Wyświetl plik

@ -94,6 +94,15 @@ module Invidious::Routing
get "/latest_version", Routes::VideoPlayback, :latest_version
end
def register_image_routes
get "/ggpht/*", Routes::Images, :ggpht
options "/sb/:authority/:id/:storyboard/:index", Routes::Images, :options_storyboard
get "/sb/:authority/:id/:storyboard/:index", Routes::Images, :get_storyboard
get "/s_p/:id/:name", Routes::Images, :s_p_image
get "/yts/img/:name", Routes::Images, :yts_image
get "/vi/:id/:name", Routes::Images, :thumbnails
end
# -------------------
# API routes
# -------------------