mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2026-02-25 01:46:00 +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::Embed < Invidious::Routes::BaseRoute
|
||||
def redirect(env)
|
||||
module Invidious::Routes::Embed
|
||||
def self.redirect(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
|
||||
if plid = env.params.query["list"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "")
|
||||
@@ -23,7 +23,7 @@ class Invidious::Routes::Embed < Invidious::Routes::BaseRoute
|
||||
env.redirect url
|
||||
end
|
||||
|
||||
def show(env)
|
||||
def self.show(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
id = env.params.url["id"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user