]> gitweb.fluxo.info Git - playlister.git/commitdiff
Copy playlist to remote location
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 18 Jan 2017 22:22:57 +0000 (20:22 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 18 Jan 2017 22:22:57 +0000 (20:22 -0200)
playlist-get

index 5f69e8a2e7694f3214a5dd1f3bba1e793070c627..a6d5b02ed945e46552b31e7301bbb3c0c1054b19 100755 (executable)
@@ -48,7 +48,7 @@ elif [ "$BASENAME" == "playlist-copy" ]; then
     DEST="`cd $DEST && pwd`"
   elif [ "$DEST" == "adb" ]; then
     APP="adb"
-    action="adb"
+    action="push"
     DEST="/storage/emulated/0/Music"
   else
     DEST="--to $DEST"
@@ -69,11 +69,16 @@ cat $PLAYLISTS/$PLAYLIST.m3u | while read file; do
     $APP $action "$file" "$DEST$prefix"
   elif [ "$action" == "get" ]; then
     $APP $action "$file"
-  elif [ "$action" == "adb" ]; then
+  elif [ "$APP" == "adb" ]; then
     prefix="/$(dirname "$file")"
-    $APP shell mkdir -p "$DEST$prefix" &> /dev/null
-    $APP push "$file"   "$DEST$prefix"
+    $APP shell mkdir -p  "$DEST$prefix" &> /dev/null
+    $APP $action "$file" "$DEST$prefix"
   else
     $APP $action "$file" $DEST
   fi
 done
+
+# Copy the playlist to the destination
+if [ "$action" != "get" ]; then
+  $APP $action "$PLAYLISTS/$PLAYLIST.m3u" $DEST/$PLAYLIST.m3u
+fi