Commit a8d2a926 authored by Cédric Marie's avatar Cédric Marie
Browse files

tag-sieve: Check multi-disc in filename



In "clean" command, instead of checking multi-disc in tags, which have
not been cleaned yet, check it in the first filename, which should
start with "1 - " in that case.
Signed-off-by: default avatarCédric Marie <cedric.marie@openmailbox.org>
parent 90274f50
......@@ -188,21 +188,24 @@ if [ "$command" = "clean" ]; then
fi
tag_tracktotal=`grep "^TRACKTOTAL=" $tags_filename | tail -n 1`
tag_tracktotal=${tag_tracktotal#TRACKTOTAL=}
tag_discnumber=`grep "^DISCNUMBER=" $tags_filename | tail -n 1`
tag_discnumber=${tag_discnumber#DISCNUMBER=}
if [ "$tag_discnumber" != "" ]; then
tag_disctotal=`grep "^DISCTOTAL=" $tags_filename | tail -n 1`
tag_disctotal=${tag_disctotal#DISCTOTAL=}
if [ "${file%% - *}" = "1" ]; then
multi_disc=1
tag_discnumber=`grep "^DISCNUMBER=" $tags_filename | tail -n 1`
tag_discnumber=${tag_discnumber#DISCNUMBER=}
if [ "$tag_discnumber" != "" ]; then
tag_disctotal=`grep "^DISCTOTAL=" $tags_filename | tail -n 1`
tag_disctotal=${tag_disctotal#DISCTOTAL=}
if [ "$tag_disctotal" = "" ]; then
printf "DISCTOTAL is missing, please enter a value for this tag: "
read tag_disctotal
fi
fi
fi
tag_comment=`grep "^COMMENT=" $tags_filename | tail -n 1`
tag_comment=${tag_comment#COMMENT=}
tag_license=`grep "^LICENSE=" $tags_filename | tail -n 1`
tag_license=${tag_license#LICENSE=}
if [ "$tag_discnumber" != "" -a "$tag_disctotal" = "" ]; then
printf "DISCTOTAL is missing, please enter a value for this tag: "
read tag_disctotal
fi
# Print album information
printf "\033[7m"
......@@ -211,11 +214,10 @@ if [ "$command" = "clean" ]; then
fi
printf "ALBUM=$tag_album\n"
printf "DATE=$tag_date\n"
if [ "$tag_discnumber" = "" ]; then
printf "TRACKTOTAL=$tag_tracktotal\n"
else
multi_disc=1
if [ "$multi_disc" = "1" ]; then
printf "DISCTOTAL=$tag_disctotal\n"
else
printf "TRACKTOTAL=$tag_tracktotal\n"
fi
if [ "$tag_comment" != "" ]; then
printf "COMMENT=$tag_comment\n"
......
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