Commit 67de06c2 authored by Cédric Marie's avatar Cédric Marie

myaudiotags: Merge 'rmblocks' into 'clean' command

There is no need for a specific command. Removing useless blocks should
be part of the 'clean' command.
Signed-off-by: default avatarCédric Marie <cedric@hjuvi.lautre.net>
parent 7fff46c5
......@@ -23,9 +23,7 @@ print_usage()
printf " -h display this message\n\n"
printf "Commands applied to all audio files in current directory (album):\n"
printf " show show tags\n"
printf " rmblocks remove seek table, picture, cue sheet, and padding blocks\n"
printf " (FLAC files only)\n"
printf " clean set only following tags (and remove padding):\n"
printf " clean set only following tags:\n"
printf " - ARTIST (from first track if not multi-artist)\n"
printf " - TITLE\n"
printf " - ALBUM (from first track)\n"
......@@ -36,6 +34,7 @@ print_usage()
printf " - DISCTOTAL (from first track if multi-disc)\n"
printf " - COMMENT (from first track, if present)\n"
printf " - LICENSE (from first track, if present)\n"
printf " (remove seek table, picture, cue sheet, and padding blocks)\n"
printf " Options for \"clean\" command:\n"
printf " -d keep full date (default: keep only the year)\n"
printf " -a multi-artist (read artist in each track)\n"
......@@ -127,30 +126,6 @@ if [ "$command" = "show" ]; then
exit 0
fi
# -----------------------------------------------------------------------------
# rmblocks (FLAC only)
# -----------------------------------------------------------------------------
if [ "$command" = "rmblocks" ]; then
# FLAC files
if [ "$flac_files" != "" ]; then
print_header "Remove seek table, picture, cue sheet, and padding blocks in all tracks"
# Set read-write permission
chmod 644 *.flac
# Remove seek table, picture, cue sheet, and padding blocks
metaflac --remove --block-type=SEEKTABLE *.flac
metaflac --remove --block-type=PICTURE *.flac
metaflac --remove --block-type=CUESHEET *.flac
metaflac --dont-use-padding --remove --block-type=PADDING *.flac
# Set read-only permission
chmod 444 *.flac
fi
exit 0
fi
# -----------------------------------------------------------------------------
# clean
# -----------------------------------------------------------------------------
......@@ -272,6 +247,7 @@ if [ "$command" = "clean" ]; then
printf "LICENSE=$tag_license\n" >> $tags_filename
fi
old_size=`stat -c %s "$file"`
metaflac --dont-use-padding --remove --block-type=SEEKTABLE,PICTURE,CUESHEET,PADDING "$file"
metaflac --remove-all-tags --dont-use-padding "$file"
metaflac --import-tags-from=$tags_filename "$file"
new_size=`stat -c %s "$file"`
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment