mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-19 03:18:50 +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::Misc < Invidious::Routes::BaseRoute
|
||||
def home(env)
|
||||
module Invidious::Routes::Misc
|
||||
def self.home(env)
|
||||
preferences = env.get("preferences").as(Preferences)
|
||||
locale = LOCALES[preferences.locale]?
|
||||
user = env.get? "user"
|
||||
@@ -26,17 +26,17 @@ class Invidious::Routes::Misc < Invidious::Routes::BaseRoute
|
||||
end
|
||||
end
|
||||
|
||||
def privacy(env)
|
||||
def self.privacy(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
templated "privacy"
|
||||
end
|
||||
|
||||
def licenses(env)
|
||||
def self.licenses(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
rendered "licenses"
|
||||
end
|
||||
|
||||
def cross_instance_redirect(env)
|
||||
def self.cross_instance_redirect(env)
|
||||
referer = get_referer(env)
|
||||
|
||||
if !env.get("preferences").as(Preferences).automatic_instance_redirect
|
||||
|
||||
Reference in New Issue
Block a user