Ameba: Fix Lint/ShadowingOuterLocalVar

This commit is contained in:
syeopite 2024-07-26 19:22:42 -07:00
parent d1cd790388
commit ecbea0b67b
No known key found for this signature in database
GPG Key ID: A73C186DA3955A1A
3 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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