From 1d6b9e7402b567f9b3274e037745d95ba3282410 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 26 Nov 2017 19:58:40 +0000 Subject: [PATCH] Option to rescan icecast playlist --- src/freedombone-app-icecast | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/freedombone-app-icecast b/src/freedombone-app-icecast index 937fdff0..61f6df31 100755 --- a/src/freedombone-app-icecast +++ b/src/freedombone-app-icecast @@ -53,6 +53,15 @@ icecast_variables=(MY_USERNAME ICECAST_CODE DEFAULT_LANGUAGE) +function icecast_rescan { + if [ -d $ICECAST_DIR ]; then + if [ -f $ICECAST_PLAYLIST_FILE ]; then + rm $ICECAST_PLAYLIST_FILE + fi + icecast_add_file_to_playlist $ICECAST_DIR + fi +} + function icecast_update_daemon { systemctl stop icecast2 if [ -f /etc/init.d/icecast2 ]; then @@ -338,7 +347,7 @@ function configure_interactive_icecast { trap "rm -f $data" 0 1 2 5 15 dialog --backtitle $"Freedombone Control Panel" \ --title $"Icecast" \ - --radiolist $"Choose an operation:" 15 70 8 \ + --radiolist $"Choose an operation:" 16 70 9 \ 1 $"Import stream files from directory" off \ 2 $"Import stream files from USB drive" off \ 3 $"Manually edit playlist" off \ @@ -346,7 +355,8 @@ function configure_interactive_icecast { 5 $"Format a USB drive for stream file storage" off \ 6 $"Enable login for stream visitors" off \ 7 $"Change password for stream visitors" off \ - 8 $"Exit" on 2> $data + 8 $"Re-scan playlist" off \ + 9 $"Exit" on 2> $data sel=$? case $sel in 1) break;; @@ -360,7 +370,10 @@ function configure_interactive_icecast { 5) icecast_format_drive;; 6) icecast_enable_login;; 7) icecast_change_login;; - 8) break;; + 8) clear + echo $'Rescanning playlist' + icecast_rescan;; + 9) break;; esac done } @@ -661,6 +674,7 @@ function install_icecast { icecast_update_daemon nginx_ensite icecast systemctl restart nginx + icecast_rescan start_icecast APP_INSTALLED=1