diff options
Diffstat (limited to 'playlist-get')
-rwxr-xr-x | playlist-get | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/playlist-get b/playlist-get deleted file mode 100755 index 170f6be..0000000 --- a/playlist-get +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -# -# Get playlist files using git-annex. -# - -# Parameters -BASENAME="`basename $0`" -PLAYLIST="$1" -DEST="$2" -MEDIA="/var/cache/media/noise" -PLAYLISTS="$MEDIA/playlists" -APP="git annex" - -# Basic syntax -if [ -z "$PLAYLIST" ]; then - echo "Usage: $BASENAME <playlist> [dest]" - - if [ -d "$PLAYLISTS" ]; then - echo "" - echo "Available playlists: " - ls $PLAYLISTS - fi - - exit 1 -elif [ ! -f "$PLAYLISTS/$PLAYLIST.m3u" ]; then - echo "No such playlist $PLAYLISTS/$PLAYLIST.m3u" - exit 1 -fi - -# Set action -if [ "$BASENAME" == "playlist-drop" ]; then - action="drop" -elif [ "$BASENAME" == "playlist-copy" ]; then - if [ -z "$DEST" ]; then - echo "No destination specified" - exit 1 - elif [ -d "$DEST" ]; then - APP="cp -Lv" - action="" - - # Force absolute path - DEST="`cd $DEST && pwd`" - else - DEST="--to $DEST" - action="copy" - fi -else - action="get" -fi - -echo "Getting files from $PLAYLISTS/$PLAYLIST.m3u..." -cd $MEDIA - -# Process -cat $PLAYLISTS/$PLAYLIST.m3u | while read file; do - if [ -z "$action" ] && [ "$APP" == "cp -Lv" ]; then - prefix="/$(dirname "$file")" - mkdir -p "$DEST$prefix" - $APP $action "$file" "$DEST$prefix" - elif [ "$action" == "get" ]; then - $APP $action "$file" - else - $APP $action "$file" $DEST - fi -done |