mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
Fix continuation for last page of playlists
This commit is contained in:
parent
c2c438637a
commit
e736626953
2 changed files with 8 additions and 7 deletions
|
@ -375,13 +375,14 @@ def fetch_channel_playlists(ucid, author, auto_generated, continuation, sort_by)
|
||||||
json = JSON.parse(response.body)
|
json = JSON.parse(response.body)
|
||||||
|
|
||||||
if json["load_more_widget_html"].as_s.empty?
|
if json["load_more_widget_html"].as_s.empty?
|
||||||
return [] of SearchItem, nil
|
continuation = nil
|
||||||
end
|
else
|
||||||
|
continuation = XML.parse_html(json["load_more_widget_html"].as_s)
|
||||||
|
continuation = continuation.xpath_node(%q(//button[@data-uix-load-more-href]))
|
||||||
|
|
||||||
continuation = XML.parse_html(json["load_more_widget_html"].as_s)
|
if continuation
|
||||||
continuation = continuation.xpath_node(%q(//button[@data-uix-load-more-href]))
|
continuation = extract_channel_playlists_cursor(continuation["data-uix-load-more-href"], auto_generated)
|
||||||
if continuation
|
end
|
||||||
continuation = extract_channel_playlists_cursor(continuation["data-uix-load-more-href"], auto_generated)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
html = XML.parse_html(json["content_html"].as_s)
|
html = XML.parse_html(json["content_html"].as_s)
|
||||||
|
|
|
@ -85,7 +85,7 @@
|
||||||
<div class="pure-g h-box">
|
<div class="pure-g h-box">
|
||||||
<div class="pure-u-1 pure-u-md-4-5"></div>
|
<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">
|
<div class="pure-u-1 pure-u-lg-1-5" style="text-align:right">
|
||||||
<% if items.size >= 28 %>
|
<% if continuation %>
|
||||||
<a href="/channel/<%= channel.ucid %>/playlists?continuation=<%= continuation %><% if sort_by != "last" %>&sort_by=<%= sort_by %><% end %>">
|
<a href="/channel/<%= channel.ucid %>/playlists?continuation=<%= continuation %><% if sort_by != "last" %>&sort_by=<%= sort_by %><% end %>">
|
||||||
<%= translate(locale, "Next page") %>
|
<%= translate(locale, "Next page") %>
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Reference in a new issue