mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-30 02:32:56 +05:30
Fix comments without startTimeSeconds
This commit is contained in:
parent
277dda0dcb
commit
b23710f89f
@ -488,10 +488,14 @@ def content_to_comment_html(content)
|
|||||||
|
|
||||||
text = %(<a href="#{url}">#{text}</a>)
|
text = %(<a href="#{url}">#{text}</a>)
|
||||||
elsif watch_endpoint = run["navigationEndpoint"]["watchEndpoint"]?
|
elsif watch_endpoint = run["navigationEndpoint"]["watchEndpoint"]?
|
||||||
length_seconds = watch_endpoint["startTimeSeconds"].as_i
|
length_seconds = watch_endpoint["startTimeSeconds"]?
|
||||||
video_id = watch_endpoint["videoId"].as_s
|
video_id = watch_endpoint["videoId"].as_s
|
||||||
|
|
||||||
|
if length_seconds
|
||||||
text = %(<a href="javascript:void(0)" onclick="player.currentTime(#{length_seconds})">#{text}</a>)
|
text = %(<a href="javascript:void(0)" onclick="player.currentTime(#{length_seconds})">#{text}</a>)
|
||||||
|
else
|
||||||
|
text = %(<a href="/watch?v=#{video_id}">#{text}</a>)
|
||||||
|
end
|
||||||
elsif url = run["navigationEndpoint"]["commandMetadata"]?.try &.["webCommandMetadata"]["url"].as_s
|
elsif url = run["navigationEndpoint"]["commandMetadata"]?.try &.["webCommandMetadata"]["url"].as_s
|
||||||
text = %(<a href="#{url}">#{text}</a>)
|
text = %(<a href="#{url}">#{text}</a>)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user