Update community post API

This commit is contained in:
syeopite 2021-07-27 23:41:20 -07:00
parent e8dc337306
commit 2a32f84332
No known key found for this signature in database
GPG key ID: 6FA616E5A5294A82
2 changed files with 22 additions and 8 deletions

View file

@ -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

View file

@ -112,12 +112,12 @@
<%- end%>
<% if cursor %>
<div class="pure-g h-box v-box">
<div class="pure-u-1 pure-u-md-4-5"></div>
<div class="pure-u-1 pure-u-lg-1-5" style="text-align:right">
<a href="/channel/<%= channel.ucid %>/community?continuation=<%=cursor%>">
<%= translate(locale, "Next page") %>
</a>
<div class="pure-g h-box v-box">
<div class="pure-u-1 pure-u-md-4-5"></div>
<div class="pure-u-1 pure-u-lg-1-5" style="text-align:right">
<a href="/channel/<%= channel.ucid %>/community?continuation=<%=cursor%>">
<%= translate(locale, "Next page") %>
</a>
</div>
</div>
</div>
<% end %>