mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-21 21:17:20 +00:00
Ameba: Fix Lint/ShadowingOuterLocalVar
This commit is contained in:
parent
d1cd790388
commit
ecbea0b67b
@ -116,7 +116,7 @@ module Invidious::Routes::API::V1::Videos
|
||||
else
|
||||
caption_xml = XML.parse(caption_xml)
|
||||
|
||||
webvtt = WebVTT.build(settings_field) do |webvtt|
|
||||
webvtt = WebVTT.build(settings_field) do |builder|
|
||||
caption_nodes = caption_xml.xpath_nodes("//transcript/text")
|
||||
caption_nodes.each_with_index do |node, i|
|
||||
start_time = node["start"].to_f.seconds
|
||||
@ -136,7 +136,7 @@ module Invidious::Routes::API::V1::Videos
|
||||
text = "<v #{md["name"]}>#{md["text"]}</v>"
|
||||
end
|
||||
|
||||
webvtt.cue(start_time, end_time, text)
|
||||
builder.cue(start_time, end_time, text)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -115,7 +115,7 @@ struct Invidious::User
|
||||
playlists.each do |item|
|
||||
title = item["title"]?.try &.as_s?.try &.delete("<>")
|
||||
description = item["description"]?.try &.as_s?.try &.delete("\r")
|
||||
privacy = item["privacy"]?.try &.as_s?.try { |privacy| PlaylistPrivacy.parse? privacy }
|
||||
privacy = item["privacy"]?.try &.as_s?.try { |raw_pl_privacy_state| PlaylistPrivacy.parse? raw_pl_privacy_state }
|
||||
|
||||
next if !title
|
||||
next if !description
|
||||
|
@ -110,13 +110,13 @@ module Invidious::Videos
|
||||
"Language" => @language_code,
|
||||
}
|
||||
|
||||
vtt = WebVTT.build(settings_field) do |vtt|
|
||||
vtt = WebVTT.build(settings_field) do |builder|
|
||||
@lines.each do |line|
|
||||
# Section headers are excluded from the VTT conversion as to
|
||||
# match the regular captions returned from YouTube as much as possible
|
||||
next if line.is_a? HeadingLine
|
||||
|
||||
vtt.cue(line.start_ms, line.end_ms, line.line)
|
||||
builder.cue(line.start_ms, line.end_ms, line.line)
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user