diff options
| author | Omar Roth <omarroth@protonmail.com> | 2019-08-30 23:57:33 -0400 |
|---|---|---|
| committer | Omar Roth <omarroth@protonmail.com> | 2019-08-31 01:11:45 -0400 |
| commit | 38962301995df1ea763370e13fdb4244b6ca3daa (patch) | |
| tree | 3949e5ddcebaaf62f9a1e074556469555105b7bd | |
| parent | b902880a05437539859fa30a81644d9a9cae1581 (diff) | |
| download | invidious-38962301995df1ea763370e13fdb4244b6ca3daa.tar.gz invidious-38962301995df1ea763370e13fdb4244b6ca3daa.tar.bz2 invidious-38962301995df1ea763370e13fdb4244b6ca3daa.zip | |
Fix type cast for viewCount
| -rw-r--r-- | src/invidious/videos.cr | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index 85ccb9a2..e454638e 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 |
