Merge pull request #2868 from SamantazFox/related-channels-items-fix

Related channel may contain a continuation entry
This commit is contained in:
Samantaz Fox
2022-02-07 16:54:44 +01:00
committed by GitHub
2 changed files with 30 additions and 9 deletions

View File

@@ -96,7 +96,14 @@ module Invidious::Routes::API::V1::Channels
json.field "relatedChannels" do
json.array do
fetch_related_channels(channel).each do |related_channel|
# Fetch related channels
begin
related_channels = fetch_related_channels(channel)
rescue ex
related_channels = [] of AboutRelatedChannel
end
related_channels.each do |related_channel|
json.object do
json.field "author", related_channel.author
json.field "authorId", related_channel.ucid
@@ -118,7 +125,8 @@ module Invidious::Routes::API::V1::Channels
end
end
end
end
end # relatedChannels
end
end
end