mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-20 11:58:48 +00:00
Fix some 'Lint/ShadowingOuterLocalVar' warnings reported by ameba
This commit is contained in:
@@ -138,7 +138,7 @@ module Invidious::Routes::API::V1::Authenticated
|
||||
return error_json(400, "Invalid title.")
|
||||
end
|
||||
|
||||
privacy = env.params.json["privacy"]?.try { |privacy| PlaylistPrivacy.parse(privacy.as(String).downcase) }
|
||||
privacy = env.params.json["privacy"]?.try { |p| PlaylistPrivacy.parse(p.as(String).downcase) }
|
||||
if !privacy
|
||||
return error_json(400, "Invalid privacy setting.")
|
||||
end
|
||||
@@ -175,7 +175,7 @@ module Invidious::Routes::API::V1::Authenticated
|
||||
end
|
||||
|
||||
title = env.params.json["title"].try &.as(String).delete("<>").byte_slice(0, 150) || playlist.title
|
||||
privacy = env.params.json["privacy"]?.try { |privacy| PlaylistPrivacy.parse(privacy.as(String).downcase) } || playlist.privacy
|
||||
privacy = env.params.json["privacy"]?.try { |p| PlaylistPrivacy.parse(p.as(String).downcase) } || playlist.privacy
|
||||
description = env.params.json["description"]?.try &.as(String).delete("\r") || playlist.description
|
||||
|
||||
if title != playlist.title ||
|
||||
|
||||
@@ -71,9 +71,9 @@ module Invidious::Routes::API::V1::Videos
|
||||
env.response.content_type = "text/vtt; charset=UTF-8"
|
||||
|
||||
if lang
|
||||
caption = captions.select { |caption| caption.language_code == lang }
|
||||
caption = captions.select(&.language_code.== lang)
|
||||
else
|
||||
caption = captions.select { |caption| caption.name == label }
|
||||
caption = captions.select(&.name.== label)
|
||||
end
|
||||
|
||||
if caption.empty?
|
||||
@@ -179,7 +179,7 @@ module Invidious::Routes::API::V1::Videos
|
||||
|
||||
env.response.content_type = "text/vtt"
|
||||
|
||||
storyboard = storyboards.select { |storyboard| width == "#{storyboard[:width]}" || height == "#{storyboard[:height]}" }
|
||||
storyboard = storyboards.select { |sb| width == "#{sb[:width]}" || height == "#{sb[:height]}" }
|
||||
|
||||
if storyboard.empty?
|
||||
haltf env, 404
|
||||
|
||||
Reference in New Issue
Block a user