Script na vykopírování songů z MPD playlistu jinam

From Chytrex, 6 Years ago, written in Bash, viewed 115 times.
URL http://minetest.wjake.com/stikked/view/f3470f69 Embed
Download Paste or View Raw
  1. #!/bin/bash
  2. MPDBASE="/hdd/hudba/"
  3. MPDPLAYLISTSDIR='/var/lib/mpd/playlists/'
  4. NUMBER=0
  5. TARGET="/hdd/data_1/converted/"
  6. PLAYL="$1"
  7.  
  8. if [ -z "$PLAYL" ]; then
  9.         ls -1 $MPDPLAYLISTSDIR
  10.         exit 0
  11. fi
  12.  
  13. if [ -e "$MPDPLAYLISTSDIR$PLAYL" ]; then
  14.         mkdir "$TARGET/$PLAYL"
  15.         cat "$MPDPLAYLISTSDIR$PLAYL" | while read line; do
  16.                 echo "got line: $MPDBASE$line"
  17.                 ((NUMBER++))
  18.                 if [ $NUMBER -lt 10 ]; then
  19.                         NEWNAME="0"$NUMBER
  20.                 else
  21.                         NEWNAME=$NUMBER
  22.                 fi
  23.                 cp "$MPDBASE$line" "$TARGET/$PLAYL/$NEWNAME - `echo ${line#*/}`"
  24.         done
  25. fi

Reply to "Script na vykopírování songů z MPD playlistu jinam"

Here you can reply to the paste above