diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2023-07-16 18:02:27 +0200 |
|---|---|---|
| committer | Samantaz Fox <coding@samantaz.fr> | 2023-07-16 18:02:27 +0200 |
| commit | ff6166edf78b7cef685967e883c110ed5770197f (patch) | |
| tree | a30c1326c1e9289f8822869392b9bc57550e08c8 /src | |
| parent | c8ade5194bab5ec077870dc962aecef3e4af29a9 (diff) | |
| parent | d16477602448f7f5ca0f04ffcebf3100575bf703 (diff) | |
| download | invidious-ff6166edf78b7cef685967e883c110ed5770197f.tar.gz invidious-ff6166edf78b7cef685967e883c110ed5770197f.tar.bz2 invidious-ff6166edf78b7cef685967e883c110ed5770197f.zip | |
Playlists: Fix pagination of Invidious playlists (#3861)
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/routes/playlists.cr | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/invidious/routes/playlists.cr b/src/invidious/routes/playlists.cr index 5cb96809..9c6843e9 100644 --- a/src/invidious/routes/playlists.cr +++ b/src/invidious/routes/playlists.cr @@ -421,8 +421,13 @@ module Invidious::Routes::Playlists return error_template(500, ex) end - page_count = (playlist.video_count / 200).to_i - page_count += 1 if (playlist.video_count % 200) > 0 + if playlist.is_a? InvidiousPlaylist + page_count = (playlist.video_count / 100).to_i + page_count += 1 if (playlist.video_count % 100) > 0 + else + page_count = (playlist.video_count / 200).to_i + page_count += 1 if (playlist.video_count % 200) > 0 + end if page > page_count return env.redirect "/playlist?list=#{plid}&page=#{page_count}" @@ -433,7 +438,11 @@ module Invidious::Routes::Playlists end begin - items = get_playlist_videos(playlist, offset: (page - 1) * 200) + if playlist.is_a? InvidiousPlaylist + items = get_playlist_videos(playlist, offset: (page - 1) * 100) + else + items = get_playlist_videos(playlist, offset: (page - 1) * 200) + end rescue ex return error_template(500, "Error encountered while retrieving playlist videos.<br>#{ex.message}") end |
