From 4ec298d153ec617bb95612b28847f41d1a96f027 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 18 Jan 2017 20:22:57 -0200 Subject: Copy playlist to remote location --- playlist-get | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/playlist-get b/playlist-get index 5f69e8a..a6d5b02 100755 --- a/playlist-get +++ b/playlist-get @@ -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 -- cgit v1.2.3