Commit a0cebde3 authored by Cédric Marie's avatar Cédric Marie

tag-sieve: Add setc command

Add a new command to set the comment tag in the first track. It will
spread across all tracks with clean command.
Signed-off-by: default avatarCédric Marie <cedric@hjuvi.lautre.net>
parent 42f8afe3
......@@ -41,6 +41,8 @@ print_usage()
printf " -a multi-artist (read artist in each track)\n"
printf " seta ARTIST ALBUM DATE\n"
printf " set artist, album, and date tags in the first track\n"
printf " setc COMMENT\n"
printf " set comment tag in the first track\n"
printf " upt update title tags from filenames\n"
printf " uptn update track number tags from filenames\n\n"
printf "Commands applied to a single audio file:\n"
......@@ -520,6 +522,51 @@ if [ "$command" = "seta" ]; then
exit 0
fi
# -----------------------------------------------------------------------------
# setc
# -----------------------------------------------------------------------------
if [ "$command" = "setc" ]; then
tag_comment=$2
if [ "$tag_comment" = "" ]; then
printf "COMMENT parameter is missing\n"
exit 1
fi
# Print comment
printf "\033[7m"
printf "COMMENT=$tag_comment\n"
printf "\033[0m"
confirm_to_continue
print_header "Set comment in the first track"
# FLAC files
if [ "$flac_files" != "" ]; then
file=`ls -1 *.flac | grep -m 1 flac`
# Set read-write permission
chmod 644 "$file"
metaflac --set-tag="COMMENT=$tag_comment" "$file"
# Set read-only permission
chmod 444 "$file"
# MP3 files
elif [ "$mp3_files" != "" ]; then
file=`ls -1 *.mp3 | grep -m 1 mp3`
# Set read-write permission
chmod 644 "$file"
id3v2 --id3v2-only --comment "$tag_comment" "$file"
# Set read-only permission
chmod 444 "$file"
fi
exit 0
fi
# -----------------------------------------------------------------------------
# set-single
# -----------------------------------------------------------------------------
......
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