WebVTT::Builder: rename #line to #cue

このコミットが含まれているのは:
syeopite 2023-08-24 15:42:42 -07:00
コミット d371eb50f2
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: A73C186DA3955A1A
5個のファイルの変更10行の追加10行の削除

ファイルの表示

@ -18,7 +18,7 @@ Spectator.describe "WebVTT::Builder" do
it "correctly builds a vtt file" do
result = WebVTT.build do |vtt|
MockLines.each do |line|
vtt.line(line["start_time"], line["end_time"], line["text"])
vtt.cue(line["start_time"], line["end_time"], line["text"])
end
end
@ -43,7 +43,7 @@ Spectator.describe "WebVTT::Builder" do
result = WebVTT.build(setting_fields) do |vtt|
MockLines.each do |line|
vtt.line(line["start_time"], line["end_time"], line["text"])
vtt.cue(line["start_time"], line["end_time"], line["text"])
end
end

ファイルの表示

@ -7,8 +7,8 @@ module WebVTT
def initialize(@io : IO)
end
# Writes an vtt line with the specified time stamp and contents
def line(start_time : Time::Span, end_time : Time::Span, text : String)
# Writes an vtt cue with the specified time stamp and contents
def cue(start_time : Time::Span, end_time : Time::Span, text : String)
timestamp(start_time, end_time)
@io << text
@io << "\n\n"
@ -48,8 +48,8 @@ module WebVTT
#
# ```
# string = WebVTT.build do |io|
# vtt.line(Time::Span.new(seconds: 1), Time::Span.new(seconds: 2), "Line 1")
# vtt.line(Time::Span.new(seconds: 2), Time::Span.new(seconds: 3), "Line 2")
# vtt.cue(Time::Span.new(seconds: 1), Time::Span.new(seconds: 2), "Line 1")
# vtt.cue(Time::Span.new(seconds: 2), Time::Span.new(seconds: 3), "Line 2")
# end
#
# string # => "WEBVTT\n\n00:00:01.000 --> 00:00:02.000\nLine 1\n\n00:00:02.000 --> 00:00:03.000\nLine 2\n\n"

ファイルの表示

@ -131,7 +131,7 @@ module Invidious::Routes::API::V1::Videos
text = "<v #{md["name"]}>#{md["text"]}</v>"
end
webvtt.line(start_time, end_time, text)
webvtt.cue(start_time, end_time, text)
end
end
end
@ -217,7 +217,7 @@ module Invidious::Routes::API::V1::Videos
storyboard[:storyboard_height].times do |j|
storyboard[:storyboard_width].times do |k|
current_cue_url = "#{url}#xywh=#{storyboard[:width] * k},#{storyboard[:height] * j},#{storyboard[:width] - 2},#{storyboard[:height]}"
vtt.line(start_time, end_time, current_cue_url)
vtt.cue(start_time, end_time, current_cue_url)
start_time += storyboard[:interval].milliseconds
end_time += storyboard[:interval].milliseconds

ファイルの表示

@ -78,7 +78,7 @@ module Invidious::Videos
end
end
vtt.line(start_time, end_time, text)
vtt.cue(start_time, end_time, text)
end
end

ファイルの表示

@ -42,7 +42,7 @@ module Invidious::Videos
# Taken from Invidious::Videos::Captions::Metadata.timedtext_to_vtt()
vtt = WebVTT.build(settings_field) do |vtt|
lines.each do |line|
vtt.line(line.start_ms, line.end_ms, line.line)
vtt.cue(line.start_ms, line.end_ms, line.line)
end
end