Skip to content

Instantly share code, notes, and snippets.

@gumayunov
Created March 27, 2011 09:33
Show Gist options
  • Save gumayunov/889080 to your computer and use it in GitHub Desktop.
Save gumayunov/889080 to your computer and use it in GitHub Desktop.
split-cue-flac
#!/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
@gumayunov
Copy link
Author

Не рассчитал, что в одной директории могут быть несколько образов. В этом случае получается каша в тегах.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment