From 4a0dece097c14464db48db93ef4affdd13386469 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Sun, 10 Apr 2022 16:42:35 +0300 Subject: [PATCH] More next pages --- funkwhale-cli.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/funkwhale-cli.sh b/funkwhale-cli.sh index 85f7248..1505f81 100755 --- a/funkwhale-cli.sh +++ b/funkwhale-cli.sh @@ -46,9 +46,13 @@ funkwhale_menu_albums() sub_menu=1 while [ $sub_menu -eq 1 ]; do titles=$(jj -i preload -l 'results.#.title' | nl -s: -v0 -w1) - menu_albums_choice=$(echo "Main menu\n$titles" | fzy) + menu_albums_choice=$(echo "Main menu\n$titles\nNext page" | fzy) case $menu_albums_choice in "Main menu") sub_menu=0 ;; + "Next page") + page=$(expr $page + 1) + get_json=$(funkwhale_api_get_albums $page) + ;; *) index=$(echo $menu_albums_choice | cut -f 1 -d:) album_id=$(jj -i preload results.$index.id) @@ -125,13 +129,17 @@ funkwhale_menu_artists() sub_menu=1 while [ $sub_menu -eq 1 ]; do names=$(echo $get_json | jj -l 'results.#.name' | nl -s: -v0 -w1) - menu_artists_choice=$(echo "Main menu\n$names" | fzy) + menu_artists_choice=$(echo "Main menu\n$names\nNext page" | fzy) case $menu_artists_choice in "Main menu") sub_menu=0 ;; + "Next page") + page=$(expr $page + 1) + get_json=$(funkwhale_api_get_artists $page) + ;; *) index=$(echo $menu_artists_choice | cut -f 1 -d:) artist_id=$(echo $get_json | jj results.$index.id) - funkwhale_menu_albums_artist $artist_id + funkwhale_menu_albums_artist $artist_id ;; esac done }