From b23710f89f23f453a7823e56258930d95fe7d46b Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sun, 20 Jan 2019 09:51:24 -0600 Subject: [PATCH] Fix comments without startTimeSeconds --- src/invidious/comments.cr | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index 1b81c6b7..c95f79b2 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -488,10 +488,14 @@ def content_to_comment_html(content) text = %(#{text}) 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 - text = %(#{text}) + if length_seconds + text = %(#{text}) + else + text = %(#{text}) + end elsif url = run["navigationEndpoint"]["commandMetadata"]?.try &.["webCommandMetadata"]["url"].as_s text = %(#{text}) end