From 1ec15dc0736c193330ae9e1eeaff2ae3a5f9e890 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Thu, 3 Feb 2022 01:44:11 +0100 Subject: [PATCH] Propagate related videos changes to API function --- 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 d8289506..74e2746c 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -446,7 +446,7 @@ struct Video end json.field "author", rv["author"] - json.field "authorUrl", rv["author_url"]? + json.field "authorUrl", "/channel/#{rv["ucid"]?}" json.field "authorId", rv["ucid"]? if rv["author_thumbnail"]? json.field "authorThumbnails" do @@ -455,7 +455,7 @@ struct Video qualities.each do |quality| json.object do - json.field "url", rv["author_thumbnail"]?.try &.gsub(/s\d+-/, "s#{quality}-") + json.field "url", rv["author_thumbnail"].try &.gsub(/s\d+-/, "s#{quality}-") json.field "width", quality json.field "height", quality end @@ -465,7 +465,7 @@ struct Video end json.field "lengthSeconds", rv["length_seconds"]?.try &.to_i - json.field "viewCountText", rv["short_view_count_text"]? + json.field "viewCountText", rv["short_view_count"]? json.field "viewCount", rv["view_count"]?.try &.empty? ? nil : rv["view_count"].to_i64 end end