mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Add support to make invidious API-only via flag (#2363)
This commit is contained in:
parent
3e781b7d13
commit
81b12b8001
10 changed files with 83 additions and 63 deletions
|
@ -1,3 +1,5 @@
|
|||
{% skip_file if flag?(:api_only) %}
|
||||
|
||||
module Invidious::Routes::Channels
|
||||
def self.home(env)
|
||||
self.videos(env)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{% skip_file if flag?(:api_only) %}
|
||||
|
||||
module Invidious::Routes::Embed
|
||||
def self.redirect(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{% skip_file if flag?(:api_only) %}
|
||||
|
||||
module Invidious::Routes::Feeds
|
||||
def self.view_all_playlists_redirect(env)
|
||||
env.redirect "/feed/playlists"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{% skip_file if flag?(:api_only) %}
|
||||
|
||||
module Invidious::Routes::Login
|
||||
def self.login_page(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{% skip_file if flag?(:api_only) %}
|
||||
|
||||
module Invidious::Routes::Misc
|
||||
def self.home(env)
|
||||
preferences = env.get("preferences").as(Preferences)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{% skip_file if flag?(:api_only) %}
|
||||
|
||||
module Invidious::Routes::Playlists
|
||||
def self.new(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{% skip_file if flag?(:api_only) %}
|
||||
|
||||
module Invidious::Routes::PreferencesRoute
|
||||
def self.show(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{% skip_file if flag?(:api_only) %}
|
||||
|
||||
module Invidious::Routes::Search
|
||||
def self.opensearch(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{% skip_file if flag?(:api_only) %}
|
||||
|
||||
module Invidious::Routes::Watch
|
||||
def self.handle(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue