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

myaudiotags: Remove -a option for 'clean' command

When an album has got a different artist for each track, the artist tag
of each track must not be overwritten by the one from the first track.

Keeping the artist tag for each track was previously possible with -a
option. But if you forgot this option, you could lose all artist tags.
It is safer to detect it automatically, and suggest that we keep all
artist tags in that case.

Remove all "Do you want to continue?" questions, since no command
requires so much precaution.

Update the year of the copyright.
Signed-off-by: default avatarCédric Marie <cedric@hjuvi.lautre.net>
parent be2fd785
Painted Shell: A collection of colorful settings and scripts for Bash shell.
Written in 2013-2018 by Cédric Marie <cedric@hjuvi.lautre.net>
Written in 2013-2019 by Cédric Marie <cedric@hjuvi.lautre.net>
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the public domain
......
......@@ -3,7 +3,7 @@
# myaudiotags - Clean audio tags
# This file is part of Painted Shell - Shell configuration and scripts.
#
# Written in 2014-2018 by Cédric Marie
# Written in 2014-2019 by Cédric Marie
#
# To the extent possible under law, the author(s) have dedicated all copyright
# and related and neighboring rights to this software to the public domain
......@@ -35,8 +35,6 @@ print_usage()
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 " -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"
......@@ -61,15 +59,6 @@ print_header()
printf "\n\033[1;32m$1\033[0m\n"
}
confirm_to_continue()
{
printf "Do you want to continue (y/N)? "
read answer
if [ "$answer" != "y" ]; then
exit 0
fi
}
while getopts h OPT
do
case $OPT in
......@@ -131,14 +120,6 @@ fi
if [ "$command" = "clean" ]; then
multi_artist=0
shift 1
while getopts ya OPT
do
case $OPT in
a) multi_artist=1;;
*) print_usage; exit 1;;
esac
done
multi_disc=0
tags_filename=/tmp/myaudiotags-clean.tags
......@@ -146,6 +127,14 @@ if [ "$command" = "clean" ]; then
if [ "$flac_files" != "" ]; then
# FLAC files
if [ "`metaflac --no-filename --show-tag=ARTIST *.flac | uniq | wc -l`" != "1" ]; then
printf "There are different ARTIST tags in files.\n"
printf "Do you want to keep a specific ARTIST tag for each track (Y/n)? "
read answer
if [ "$answer" != "n" ]; then
multi_artist=1
fi
fi
# Get album information from the first track
file=`ls -1 *.flac | grep -m 1 flac`
print_header "Get album information from the first track ($file)"
......@@ -196,8 +185,6 @@ if [ "$command" = "clean" ]; then
fi
printf "\033[0m"
confirm_to_continue
print_header "Set tags in all tracks"
# Set read-write permission
......@@ -283,8 +270,6 @@ if [ "$command" = "clean" ]; then
fi
printf "\033[0m"
confirm_to_continue
print_header "Set tags in all tracks"
# Set read-write permission
......@@ -446,8 +431,6 @@ if [ "$command" = "seta" ]; then
printf "DATE=$tag_date\n"
printf "\033[0m"
confirm_to_continue
print_header "Set artist, album, and date in the first track"
if [ "$flac_files" != "" ]; then
......@@ -493,8 +476,6 @@ if [ "$command" = "setc" ]; then
printf "COMMENT=$tag_comment\n"
printf "\033[0m"
confirm_to_continue
print_header "Set comment in the first track"
if [ "$flac_files" != "" ]; then
......@@ -553,8 +534,6 @@ if [ "$command" = "set-single" ]; then
printf "DATE=$tag_date\n"
printf "\033[0m"
confirm_to_continue
print_header "Set artist, title, and date in this file"
# FLAC files
......
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