From 2a32f8433293d010f5581696ec394d04f77de672 Mon Sep 17 00:00:00 2001 From: syeopite Date: Tue, 27 Jul 2021 23:41:20 -0700 Subject: [PATCH] Update community post API --- src/invidious/routes/api/v1/channels.cr | 16 +++++++++++++++- src/invidious/views/community.ecr | 14 +++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/invidious/routes/api/v1/channels.cr b/src/invidious/routes/api/v1/channels.cr index 480112a1..087d232e 100644 --- a/src/invidious/routes/api/v1/channels.cr +++ b/src/invidious/routes/api/v1/channels.cr @@ -235,7 +235,21 @@ module Invidious::Routes::API::V1::Channels # sort_by = env.params.query["sort_by"]?.try &.downcase begin - # fetch_channel_community(ucid, continuation, locale, format, thin_mode) + if continuation + results = fetch_channel_community(ucid, continuation) + else + results = fetch_channel_community(ucid) + end + + JSON.build do |json| + json.array do + results[0].each do |item| + item.to_json(locale, json) + end + + json.string results[1] + end + end rescue ex return error_json(500, ex) end diff --git a/src/invidious/views/community.ecr b/src/invidious/views/community.ecr index 899e6348..d858fdf5 100644 --- a/src/invidious/views/community.ecr +++ b/src/invidious/views/community.ecr @@ -112,12 +112,12 @@ <%- end%> <% if cursor %> -
-
- <% end %> \ No newline at end of file