mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2026-01-05 22:41:28 +00:00
Switch routing logic to use modules (#2298)
* Switch routing logic to use modules * Add more macros for adding routes of different HTTP methods
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class Invidious::Routes::Search < Invidious::Routes::BaseRoute
|
||||
def opensearch(env)
|
||||
module Invidious::Routes::Search
|
||||
def self.opensearch(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
env.response.content_type = "application/opensearchdescription+xml"
|
||||
|
||||
@@ -15,7 +15,7 @@ class Invidious::Routes::Search < Invidious::Routes::BaseRoute
|
||||
end
|
||||
end
|
||||
|
||||
def results(env)
|
||||
def self.results(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
|
||||
query = env.params.query["search_query"]?
|
||||
@@ -34,7 +34,7 @@ class Invidious::Routes::Search < Invidious::Routes::BaseRoute
|
||||
end
|
||||
end
|
||||
|
||||
def search(env)
|
||||
def self.search(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
region = env.params.query["region"]?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user