mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
Removed unneccesary String::Builder and removed cues that was just a blank line
This commit is contained in:
parent
9d83e2da4e
commit
76758baab8
1 changed files with 9 additions and 7 deletions
|
@ -41,9 +41,11 @@ module Invidious::Videos
|
||||||
if item.name == "body"
|
if item.name == "body"
|
||||||
item.children.each do |cue|
|
item.children.each do |cue|
|
||||||
if cue.name == "p"
|
if cue.name == "p"
|
||||||
|
if !(cue.children.size == 1 && cue.children[0].content == "\n")
|
||||||
cues << cue
|
cues << cue
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -71,13 +73,13 @@ module Invidious::Videos
|
||||||
start_time = "#{start_time.hours.to_s.rjust(2, '0')}:#{start_time.minutes.to_s.rjust(2, '0')}:#{start_time.seconds.to_s.rjust(2, '0')}.#{start_time.milliseconds.to_s.rjust(3, '0')}"
|
start_time = "#{start_time.hours.to_s.rjust(2, '0')}:#{start_time.minutes.to_s.rjust(2, '0')}:#{start_time.seconds.to_s.rjust(2, '0')}.#{start_time.milliseconds.to_s.rjust(3, '0')}"
|
||||||
|
|
||||||
end_time = "#{end_time.hours.to_s.rjust(2, '0')}:#{end_time.minutes.to_s.rjust(2, '0')}:#{end_time.seconds.to_s.rjust(2, '0')}.#{end_time.milliseconds.to_s.rjust(3, '0')}"
|
end_time = "#{end_time.hours.to_s.rjust(2, '0')}:#{end_time.minutes.to_s.rjust(2, '0')}:#{end_time.seconds.to_s.rjust(2, '0')}.#{end_time.milliseconds.to_s.rjust(3, '0')}"
|
||||||
text = String.build do |text|
|
|
||||||
node.children.each do |s|
|
|
||||||
text << s.content
|
|
||||||
end
|
|
||||||
end
|
|
||||||
result << start_time + " --> " + end_time + "\n"
|
result << start_time + " --> " + end_time + "\n"
|
||||||
result << text + "\n"
|
|
||||||
|
node.children.each do |s|
|
||||||
|
result << s.content
|
||||||
|
end
|
||||||
|
result << "\n"
|
||||||
result << "\n"
|
result << "\n"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue