diff options
author | trizen <trizen@protonmail.com> | 2020-03-06 04:45:26 +0200 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-03-07 14:02:09 -0500 |
commit | 1cddf3aff73e53e07c816b9974347d4dbe8c33c3 (patch) | |
tree | fc99ae6378572a6014d0c3b63762268175b60640 /bin/gtk-fair-viewer | |
parent | 82dacf03883cacbb27aad0fadee541e82684f299 (diff) | |
download | fair-viewer-1cddf3aff73e53e07c816b9974347d4dbe8c33c3.tar.lz fair-viewer-1cddf3aff73e53e07c816b9974347d4dbe8c33c3.tar.xz fair-viewer-1cddf3aff73e53e07c816b9974347d4dbe8c33c3.zip |
- Support for next pages of playlists from username. - Better detection for the last page of results.
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'bin/gtk-fair-viewer')
-rwxr-xr-x | bin/gtk-fair-viewer | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/bin/gtk-fair-viewer b/bin/gtk-fair-viewer index bc9c747..42ab174 100755 --- a/bin/gtk-fair-viewer +++ b/bin/gtk-fair-viewer @@ -2404,16 +2404,14 @@ sub make_row_description { } sub append_next_page { - my ($url) = @_; - - #$token // return; # no next page is available - + my ($url, $continuation) = @_; my $iter = $liststore->append; $liststore->set( $iter, 0 => "<big><b>LOAD MORE</b></big>", 3 => $url, + 5 => $continuation, 7 => 'next_page', ); } @@ -2663,7 +2661,14 @@ sub display_results { } } - append_next_page($url); #, #$info->{nextPageToken}); + if (ref($results->{results}) eq 'HASH' and exists($results->{results}{continuation})) { + if (defined $results->{results}{continuation}) { + append_next_page($url, $results->{results}{continuation}); + } + } + else { + append_next_page($url); + } } sub set_entry_tooltip { |