Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ ! "$1" ]; then
- echo "Give a path as argument"
- exit 1
- fi
- function is_seekable
- {
- if [ ! "$1" ]; then
- exit 1
- fi
- if [ "$(metaflac --list --block-type=SEEKTABLE "$1" 2> /dev/null)" = "" ]; then
- if metaflac --list --block-type=SEEKTABLE "$1" 2> /dev/null; then
- return 1
- else
- return 0
- fi
- else
- return 0
- fi
- }
- count=0
- find . -iname '*.flac' | while read i
- do
- echo "checking $i"
- if ! is_seekable "$i"; then
- metaflac --add-seekpoint=1s "$i"
- echo "* Added seekpoints to file $i"
- let count++
- fi
- done
- if [ $count -eq 0 ]; then
- echo "There were no flac files without checkpoints in folder $1"
- else
- echo "Successfully added seekpoints to $count flac file(s)"
- fi
Add Comment
Please, Sign In to add comment