From 38962301995df1ea763370e13fdb4244b6ca3daa Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Fri, 30 Aug 2019 23:57:33 -0400 Subject: [PATCH] Fix type cast for viewCount --- src/invidious/videos.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index 85ccb9a2a..e454638ea 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -428,8 +428,8 @@ struct Video end json.field "author", rv["author"] - json.field "authorUrl", rv["author_url"] if rv["author_url"]? - json.field "authorId", rv["ucid"] if rv["ucid"]? + json.field "authorUrl", rv["author_url"]? + json.field "authorId", rv["ucid"]? if rv["author_thumbnail"]? json.field "authorThumbnails" do json.array do @@ -448,7 +448,7 @@ struct Video json.field "lengthSeconds", rv["length_seconds"].to_i json.field "viewCountText", rv["short_view_count_text"] - json.field "viewCount", rv["view_count"].to_i if rv["view_count"]? + json.field "viewCount", rv["view_count"]?.try &.to_i64 end end end