From 0a4d793556e89e48b1a4caceaf8b8730b4b69d73 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Wed, 10 Aug 2022 00:31:15 +0200 Subject: [PATCH] routing: move search routes registration to Invidious::Routing --- src/invidious.cr | 5 +---- src/invidious/routing.cr | 11 +++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/invidious.cr b/src/invidious.cr index f134886f6..e880db192 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -341,10 +341,7 @@ end Invidious::Routing.register_iv_playlist_routes Invidious::Routing.register_yt_playlist_routes - Invidious::Routing.get "/opensearch.xml", Invidious::Routes::Search, :opensearch - Invidious::Routing.get "/results", Invidious::Routes::Search, :results - Invidious::Routing.get "/search", Invidious::Routes::Search, :search - Invidious::Routing.get "/hashtag/:hashtag", Invidious::Routes::Search, :hashtag + Invidious::Routing.register_search_routes # User routes Invidious::Routing.register_user_routes diff --git a/src/invidious/routing.cr b/src/invidious/routing.cr index 4074ef189..828deaf94 100644 --- a/src/invidious/routing.cr +++ b/src/invidious/routing.cr @@ -105,6 +105,17 @@ module Invidious::Routing get "/watch_videos", Routes::Playlists, :watch_videos end + def register_search_routes + get "/opensearch.xml", Routes::Search, :opensearch + get "/results", Routes::Search, :results + get "/search", Routes::Search, :search + get "/hashtag/:hashtag", Routes::Search, :hashtag + end + + # ------------------- + # Media proxy routes + # ------------------- + def register_api_manifest_routes get "/api/manifest/dash/id/:id", Routes::API::Manifest, :get_dash_video_id