From c5e0d993aee7dabf287c580ca06cdaf3b046d022 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Sat, 2 Apr 2022 18:50:24 +0300 Subject: [PATCH] sub menu --- funkwhale-cli.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/funkwhale-cli.sh b/funkwhale-cli.sh index b7e88fc..88858a1 100755 --- a/funkwhale-cli.sh +++ b/funkwhale-cli.sh @@ -18,6 +18,7 @@ funkwhale_api_get_tracks() funkwhale_api_get_tracks_from_channel() { + sub_menu=1 track_list=$(curl -s --compressed "$instance_point/tracks?channel=$1&playable=true&include_channels=true") echo "Loaded $(echo $track_list | jj count) podcasts" @@ -32,9 +33,17 @@ funkwhale_api_get_tracks_from_channel() echo "https://$instance$i\n" >> podcast.m3u8 counter=$(expr $counter + 1) done - menu_podcast_choice=$(echo $track_list | jj -l 'results.#.title' | sed 's/["#\.]//g' | fzy) - play_track=$(echo $track_name_url | jj "$menu_podcast_choice") - $default_player_command "https://$instance$play_track" + + while [ $sub_menu -eq 1 ]; do + menu_podcast_choice=$(echo $track_list | jj -l 'results.#.title' | sed 's/["#\.]//g' | fzy) + play_track=$(echo $track_name_url | jj "$menu_podcast_choice") + $default_player_command "https://$instance$play_track" + case $(echo "Back\nMain menu" | fzy) in + "Back") echo '' ;; + + "Main menu") sub_menu=0 ;; + esac + done } funkwhale_get_podcasts_artists()