switchable instance feature added

This commit is contained in:
localhost_frssoft 2022-03-30 19:58:30 +03:00
parent ae6dd9f069
commit d4d5a17268

View file

@ -34,16 +34,22 @@ load_tracks_to_playlist()
done
}
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