switch main menu to case code

This commit is contained in:
localhost_frssoft 2022-04-02 03:16:31 +03:00
parent 009abf2065
commit 77c62d575e

View File

@ -95,7 +95,8 @@ Exit='Exit'
while true; do
choice=$(echo "$downloadtrackspls\n$startplayer\n$podcasts\n$changepod\n$checkapilimits\n$Exit" | fzy)
if [ "$choice" = "$downloadtrackspls" ]; then
case "$choice" in
"$downloadtrackspls")
echo 'Order by (prefix - is DESC ordering):'
ordering=$(echo 'title\n-title\ncreation_date\n-creation_date\nrelease_date\n-release_date\nrandom' | fzy)
export ordering
@ -107,14 +108,20 @@ if [ "$choice" = "$downloadtrackspls" ]; then
export tag
echo 'Enter page number: '
read page
load_tracks_to_playlist $page
elif [ "$choice" = "$startplayer" ]; then
$default_player_command playlist.m3u8
elif [ "$choice" = "$podcasts" ]; then
load_tracks_to_playlist $page ;;
"$startplayer")
$default_player_command playlist.m3u8 ;;
"$podcasts")
echo 'Enter page number: '
read page
funkwhale_get_podcasts_artists $page
elif [ "$choice" = "$changepod" ]; then
funkwhale_get_podcasts_artists $page ;;
"$changepod")
if [ 'Choice from list' = "$(echo 'Choice from list\nManual input' | fzy)" ]; then
instance=$(jj -l -i config.json public_list_instances | sed 's/"//g' | fzy)
else
@ -131,10 +138,14 @@ elif [ "$choice" = "$changepod" ]; then
echo ''
fi
clear
get_all_avalaible_count_tracks
elif [ "$choice" = "$checkapilimits" ]; then
funkwhale_api_check_api_limits | more
elif [ "$choice" = "$Exit" ]; then
exit 0
fi
get_all_avalaible_count_tracks ;;
"$checkapilimits")
funkwhale_api_check_api_limits | more ;;
"$Exit")
exit 0 ;;
esac
done