diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-01-18 20:22:57 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-01-18 20:22:57 -0200 |
commit | 4ec298d153ec617bb95612b28847f41d1a96f027 (patch) | |
tree | cc0099351c1d82d14cd6e5f4361705a15f619caa | |
parent | cd90fba34712035ae288de4886cd737b1aa99476 (diff) | |
download | playlister-4ec298d153ec617bb95612b28847f41d1a96f027.tar.gz playlister-4ec298d153ec617bb95612b28847f41d1a96f027.tar.bz2 |
Copy playlist to remote location
-rwxr-xr-x | playlist-get | 13 |
1 files 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 |