From 94003c9c7e7f07127a5ae5ce39c0569c7627136b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 25 May 2017 21:35:51 +0100 Subject: [PATCH] Import music from USB drive --- src/freedombone-app-koel | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/freedombone-app-koel b/src/freedombone-app-koel index 4b256524..4e19878b 100755 --- a/src/freedombone-app-koel +++ b/src/freedombone-app-koel @@ -194,7 +194,22 @@ function koel_import_from_directory { } function koel_import_from_usb { - echo -n '' + clear + detect_usb_drive + + if [ ! -b $USB_DRIVE ]; then + dialog --title $"Import music from USB drive" --msgbox $'No USB drive found' 6 50 + return + fi + + backup_mount_drive ${USB_DRIVE} ${MY_USERNAME} + if [ ! -d $USB_MOUNT/Music ]; then + dialog --title $"Import music from USB drive" --msgbox $'No Music directory found on USB drive' 6 50 + backup_unmount_drive ${USB_DRIVE} + fi + cp -r $USB_MOUNT/Music/* /music + backup_unmount_drive ${USB_DRIVE} + dialog --title $"Import music from USB drive" --msgbox $'Import complete. You may now remove the USB drive' 6 50 } function configure_interactive_koel {