mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-22 13:37:24 +00:00
Remove useless 'locale = env.get...' from many routes
This commit is contained in:
parent
fa99c9aa85
commit
4cd7a3e83f
@ -115,8 +115,6 @@ module Invidious::Routes::API::V1::Authenticated
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.list_playlists(env)
|
def self.list_playlists(env)
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
|
||||||
|
|
||||||
env.response.content_type = "application/json"
|
env.response.content_type = "application/json"
|
||||||
user = env.get("user").as(User)
|
user = env.get("user").as(User)
|
||||||
|
|
||||||
@ -134,7 +132,6 @@ module Invidious::Routes::API::V1::Authenticated
|
|||||||
def self.create_playlist(env)
|
def self.create_playlist(env)
|
||||||
env.response.content_type = "application/json"
|
env.response.content_type = "application/json"
|
||||||
user = env.get("user").as(User)
|
user = env.get("user").as(User)
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
|
||||||
|
|
||||||
title = env.params.json["title"]?.try &.as(String).delete("<>").byte_slice(0, 150)
|
title = env.params.json["title"]?.try &.as(String).delete("<>").byte_slice(0, 150)
|
||||||
if !title
|
if !title
|
||||||
@ -160,8 +157,6 @@ module Invidious::Routes::API::V1::Authenticated
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.update_playlist_attribute(env)
|
def self.update_playlist_attribute(env)
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
|
||||||
|
|
||||||
env.response.content_type = "application/json"
|
env.response.content_type = "application/json"
|
||||||
user = env.get("user").as(User)
|
user = env.get("user").as(User)
|
||||||
|
|
||||||
@ -197,8 +192,6 @@ module Invidious::Routes::API::V1::Authenticated
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.delete_playlist(env)
|
def self.delete_playlist(env)
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
|
||||||
|
|
||||||
env.response.content_type = "application/json"
|
env.response.content_type = "application/json"
|
||||||
user = env.get("user").as(User)
|
user = env.get("user").as(User)
|
||||||
|
|
||||||
@ -219,8 +212,6 @@ module Invidious::Routes::API::V1::Authenticated
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.insert_video_into_playlist(env)
|
def self.insert_video_into_playlist(env)
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
|
||||||
|
|
||||||
env.response.content_type = "application/json"
|
env.response.content_type = "application/json"
|
||||||
user = env.get("user").as(User)
|
user = env.get("user").as(User)
|
||||||
|
|
||||||
@ -274,8 +265,6 @@ module Invidious::Routes::API::V1::Authenticated
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.delete_video_in_playlist(env)
|
def self.delete_video_in_playlist(env)
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
|
||||||
|
|
||||||
env.response.content_type = "application/json"
|
env.response.content_type = "application/json"
|
||||||
user = env.get("user").as(User)
|
user = env.get("user").as(User)
|
||||||
|
|
||||||
@ -389,8 +378,8 @@ module Invidious::Routes::API::V1::Authenticated
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.unregister_token(env)
|
def self.unregister_token(env)
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
|
||||||
env.response.content_type = "application/json"
|
env.response.content_type = "application/json"
|
||||||
|
|
||||||
user = env.get("user").as(User)
|
user = env.get("user").as(User)
|
||||||
scopes = env.get("scopes").as(Array(String))
|
scopes = env.get("scopes").as(Array(String))
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
module Invidious::Routes::API::V1::Misc
|
module Invidious::Routes::API::V1::Misc
|
||||||
# Stats API endpoint for Invidious
|
# Stats API endpoint for Invidious
|
||||||
def self.stats(env)
|
def self.stats(env)
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
|
||||||
env.response.content_type = "application/json"
|
env.response.content_type = "application/json"
|
||||||
|
|
||||||
if !CONFIG.statistics_enabled
|
if !CONFIG.statistics_enabled
|
||||||
@ -15,8 +14,6 @@ module Invidious::Routes::API::V1::Misc
|
|||||||
# user playlists and Invidious playlists. This means that we can't
|
# user playlists and Invidious playlists. This means that we can't
|
||||||
# reasonably split them yet. This should be addressed in APIv2
|
# reasonably split them yet. This should be addressed in APIv2
|
||||||
def self.get_playlist(env : HTTP::Server::Context)
|
def self.get_playlist(env : HTTP::Server::Context)
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
|
||||||
|
|
||||||
env.response.content_type = "application/json"
|
env.response.content_type = "application/json"
|
||||||
plid = env.params.url["plid"]
|
plid = env.params.url["plid"]
|
||||||
|
|
||||||
|
@ -20,8 +20,6 @@ module Invidious::Routes::API::V1::Videos
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.captions(env)
|
def self.captions(env)
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
|
||||||
|
|
||||||
env.response.content_type = "application/json"
|
env.response.content_type = "application/json"
|
||||||
|
|
||||||
id = env.params.url["id"]
|
id = env.params.url["id"]
|
||||||
@ -149,8 +147,6 @@ module Invidious::Routes::API::V1::Videos
|
|||||||
# thumbnails for individual scenes in a video.
|
# thumbnails for individual scenes in a video.
|
||||||
# See https://support.jwplayer.com/articles/how-to-add-preview-thumbnails
|
# See https://support.jwplayer.com/articles/how-to-add-preview-thumbnails
|
||||||
def self.storyboards(env)
|
def self.storyboards(env)
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
|
||||||
|
|
||||||
env.response.content_type = "application/json"
|
env.response.content_type = "application/json"
|
||||||
|
|
||||||
id = env.params.url["id"]
|
id = env.params.url["id"]
|
||||||
@ -223,8 +219,6 @@ module Invidious::Routes::API::V1::Videos
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.annotations(env)
|
def self.annotations(env)
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
|
||||||
|
|
||||||
env.response.content_type = "text/xml"
|
env.response.content_type = "text/xml"
|
||||||
|
|
||||||
id = env.params.url["id"]
|
id = env.params.url["id"]
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
module Invidious::Routes::Embed
|
module Invidious::Routes::Embed
|
||||||
def self.redirect(env)
|
def self.redirect(env)
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
|
||||||
|
|
||||||
if plid = env.params.query["list"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "")
|
if plid = env.params.query["list"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "")
|
||||||
begin
|
begin
|
||||||
playlist = get_playlist(plid)
|
playlist = get_playlist(plid)
|
||||||
@ -26,7 +24,6 @@ module Invidious::Routes::Embed
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.show(env)
|
def self.show(env)
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
|
||||||
id = env.params.url["id"]
|
id = env.params.url["id"]
|
||||||
|
|
||||||
plid = env.params.query["list"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "")
|
plid = env.params.query["list"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "")
|
||||||
|
Loading…
Reference in New Issue
Block a user