From d4d5a1726838476d63a96fafcf5bd958b1929c5a Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Wed, 30 Mar 2022 19:58:30 +0300 Subject: [PATCH] switchable instance feature added --- funkwhale-cli.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/funkwhale-cli.sh b/funkwhale-cli.sh index 854bc77..d4187f9 100755 --- a/funkwhale-cli.sh +++ b/funkwhale-cli.sh @@ -34,16 +34,22 @@ load_tracks_to_playlist() done } -funkwhale_api_get_tracks 1 1>> /dev/null -echo "Tracks avalaible on $instance: $count_all_tracks\n" +get_all_avalaible_count_tracks() +{ + funkwhale_api_get_tracks 1 1>> /dev/null + echo "Tracks avalaible on $instance: $count_all_tracks\n" +} + +get_all_avalaible_count_tracks downloadtrackspls='Download tracks in playlist' startplayer='Start player' +changepod='Switch instance' checkapilimits='Check API limits (debug)' Exit='Exit' while true; do -choice=$(echo "$downloadtrackspls\n$startplayer\n$checkapilimits\n$Exit" | fzy) +choice=$(echo "$downloadtrackspls\n$startplayer\n$checkapilimits\n$changepod\n$Exit" | fzy) if [ "$choice" = "$downloadtrackspls" ]; then echo 'Enter page number: ' @@ -51,6 +57,12 @@ if [ "$choice" = "$downloadtrackspls" ]; then load_tracks_to_playlist $page elif [ "$choice" = "$startplayer" ]; then $default_player --no-vid --no-ytdl playlist.m3u8 +elif [ "$choice" = "$changepod" ]; then + echo "Type instance (ex. $instance):" + read instance + export instance + clear + get_all_avalaible_count_tracks elif [ "$choice" = "$checkapilimits" ]; then funkwhale_api_check_api_limits | more elif [ "$choice" = "$Exit" ]; then