From 756d11f99ce41b12fa23a478deecd7cc085e5750 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Thu, 31 Mar 2022 01:48:53 +0300 Subject: [PATCH] Create config file, choice state instance, reorder menu --- config.json | 3 +++ funkwhale-cli.sh | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 config.json diff --git a/config.json b/config.json new file mode 100644 index 0000000..2b18d77 --- /dev/null +++ b/config.json @@ -0,0 +1,3 @@ +{ + "instance": "sound.redeyes.club" +} diff --git a/funkwhale-cli.sh b/funkwhale-cli.sh index 96881ed..3889b1f 100755 --- a/funkwhale-cli.sh +++ b/funkwhale-cli.sh @@ -1,6 +1,6 @@ #!/bin/sh -instance='sound.redeyes.club' +instance=$(jj -i config.json instance) default_player=mpv ordering='title' @@ -49,7 +49,7 @@ checkapilimits='Check API limits (debug)' Exit='Exit' while true; do -choice=$(echo "$downloadtrackspls\n$startplayer\n$checkapilimits\n$changepod\n$Exit" | fzy) +choice=$(echo "$downloadtrackspls\n$startplayer\n$changepod\n$checkapilimits\n$Exit" | fzy) if [ "$choice" = "$downloadtrackspls" ]; then echo 'Order by (prefix - is DESC ordering):' @@ -64,6 +64,12 @@ elif [ "$choice" = "$changepod" ]; then echo "Type instance (ex. $instance):" read instance export instance + conf_instance_state=$(echo 'Permanent\nTemporaly' | fzy) + if [ "$conf_instance_state" = 'Permanent' ]; then + jj -i config.json instance -v $instance -o config.json + else + echo '' + fi clear get_all_avalaible_count_tracks elif [ "$choice" = "$checkapilimits" ]; then