Created
March 27, 2011 09:33
-
-
Save gumayunov/889080 to your computer and use it in GitHub Desktop.
split-cue-flac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Dependencies: | |
# sudo apt-get install cuetools shntool | |
SAVEIFS=$IFS | |
IFS='\n' | |
find ./ -name '*.flac' -size +100M | while read image | |
do | |
echo "$image" | |
DIR=`dirname "$image"` | |
BASE=`basename "$image"` | |
BASE=`echo "$BASE" | sed -e 's/.flac//'` | |
CUE=$BASE.cue | |
IMAGE=$BASE.flac | |
cd "$DIR" | |
echo "Splitting with shnsplit" | |
shnsplit -o flac -f "$CUE" -t "%n – %t" "$IMAGE" | |
echo "Moving $IMAGE -> ${IMAGE}_" | |
mv "$IMAGE" "${IMAGE}_" | |
echo "Fixing tags with cuetag" | |
cuetag "$CUE" ./*.flac | |
cd ../ | |
done | |
IFS=$SAVEIFS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Не рассчитал, что в одной директории могут быть несколько образов. В этом случае получается каша в тегах.