mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
Update community post API
This commit is contained in:
parent
e8dc337306
commit
2a32f84332
2 changed files with 22 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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 %>
|
Loading…
Reference in a new issue