瀏覽代碼

Import music from USB drive

Bob Mottram 8 年之前
父節點
當前提交
94003c9c7e
共有 1 個檔案被更改,包括 16 行新增1 行删除
  1. 16
    1
      src/freedombone-app-koel

+ 16
- 1
src/freedombone-app-koel 查看文件

@@ -194,7 +194,22 @@ function koel_import_from_directory {
194 194
 }
195 195
 
196 196
 function koel_import_from_usb {
197
-    echo -n ''
197
+    clear
198
+    detect_usb_drive
199
+
200
+    if [ ! -b $USB_DRIVE ]; then
201
+        dialog --title $"Import music from USB drive" --msgbox $'No USB drive found' 6 50
202
+        return
203
+    fi
204
+
205
+    backup_mount_drive ${USB_DRIVE} ${MY_USERNAME}
206
+    if [ ! -d $USB_MOUNT/Music ]; then
207
+        dialog --title $"Import music from USB drive" --msgbox $'No Music directory found on USB drive' 6 50
208
+        backup_unmount_drive ${USB_DRIVE}
209
+    fi
210
+    cp -r $USB_MOUNT/Music/* /music
211
+    backup_unmount_drive ${USB_DRIVE}
212
+    dialog --title $"Import music from USB drive" --msgbox $'Import complete. You may now remove the USB drive' 6 50
198 213
 }
199 214
 
200 215
 function configure_interactive_koel {