Browse Source

Option to rescan icecast playlist

Bob Mottram 7 years ago
parent
commit
1d6b9e7402
1 changed files with 17 additions and 3 deletions
  1. 17
    3
      src/freedombone-app-icecast

+ 17
- 3
src/freedombone-app-icecast View File

@@ -53,6 +53,15 @@ icecast_variables=(MY_USERNAME
53 53
                    ICECAST_CODE
54 54
                    DEFAULT_LANGUAGE)
55 55
 
56
+function icecast_rescan {
57
+    if [ -d $ICECAST_DIR ]; then
58
+        if [ -f $ICECAST_PLAYLIST_FILE ]; then
59
+            rm $ICECAST_PLAYLIST_FILE
60
+        fi
61
+        icecast_add_file_to_playlist $ICECAST_DIR
62
+    fi
63
+}
64
+
56 65
 function icecast_update_daemon {
57 66
     systemctl stop icecast2
58 67
     if [ -f /etc/init.d/icecast2 ]; then
@@ -338,7 +347,7 @@ function configure_interactive_icecast {
338 347
         trap "rm -f $data" 0 1 2 5 15
339 348
         dialog --backtitle $"Freedombone Control Panel" \
340 349
                --title $"Icecast" \
341
-               --radiolist $"Choose an operation:" 15 70 8 \
350
+               --radiolist $"Choose an operation:" 16 70 9 \
342 351
                1 $"Import stream files from directory" off \
343 352
                2 $"Import stream files from USB drive" off \
344 353
                3 $"Manually edit playlist" off \
@@ -346,7 +355,8 @@ function configure_interactive_icecast {
346 355
                5 $"Format a USB drive for stream file storage" off \
347 356
                6 $"Enable login for stream visitors" off \
348 357
                7 $"Change password for stream visitors" off \
349
-               8 $"Exit" on 2> $data
358
+               8 $"Re-scan playlist" off \
359
+               9 $"Exit" on 2> $data
350 360
         sel=$?
351 361
         case $sel in
352 362
             1) break;;
@@ -360,7 +370,10 @@ function configure_interactive_icecast {
360 370
             5) icecast_format_drive;;
361 371
             6) icecast_enable_login;;
362 372
             7) icecast_change_login;;
363
-            8) break;;
373
+            8) clear
374
+               echo $'Rescanning playlist'
375
+               icecast_rescan;;
376
+            9) break;;
364 377
         esac
365 378
     done
366 379
 }
@@ -661,6 +674,7 @@ function install_icecast {
661 674
     icecast_update_daemon
662 675
     nginx_ensite icecast
663 676
     systemctl restart nginx
677
+    icecast_rescan
664 678
     start_icecast
665 679
 
666 680
     APP_INSTALLED=1