More next pages

This commit is contained in:
localhost_frssoft 2022-04-10 16:42:35 +03:00
parent bd5a14234f
commit 4a0dece097

View file

@ -46,9 +46,13 @@ funkwhale_menu_albums()
sub_menu=1 sub_menu=1
while [ $sub_menu -eq 1 ]; do while [ $sub_menu -eq 1 ]; do
titles=$(jj -i preload -l 'results.#.title' | nl -s: -v0 -w1) 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 case $menu_albums_choice in
"Main menu") sub_menu=0 ;; "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:) index=$(echo $menu_albums_choice | cut -f 1 -d:)
album_id=$(jj -i preload results.$index.id) album_id=$(jj -i preload results.$index.id)
@ -125,13 +129,17 @@ funkwhale_menu_artists()
sub_menu=1 sub_menu=1
while [ $sub_menu -eq 1 ]; do while [ $sub_menu -eq 1 ]; do
names=$(echo $get_json | jj -l 'results.#.name' | nl -s: -v0 -w1) 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 case $menu_artists_choice in
"Main menu") sub_menu=0 ;; "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:) index=$(echo $menu_artists_choice | cut -f 1 -d:)
artist_id=$(echo $get_json | jj results.$index.id) artist_id=$(echo $get_json | jj results.$index.id)
funkwhale_menu_albums_artist $artist_id funkwhale_menu_albums_artist $artist_id ;;
esac esac
done done
} }