add encode all, fix a bit of tags with split_tracks

This commit is contained in:
Luke Tidd
2023-05-17 13:01:10 -04:00
parent 05030e709b
commit 831034bd14
2 changed files with 65 additions and 7 deletions

View File

@@ -90,16 +90,19 @@ find "$src_library" -type f -name '*.flac' | while read file; do
declare -A tags
echo tag time
while read -r line; do
echo line: $line
tag_type="$(cut -d= -f1 <<< "$line")"
tag_type="${tag_type^^}"
tag_val="$(cut -d= -f2- <<< "$line")"
tags[$tag_type]="${tag_val^^}"
tags["$tag_type"]="$tag_val"
done < <(metaflac --list --block-type=VORBIS_COMMENT "$file" | grep 'comment\[' | cut -d: -f2- | sed 's/^ //')
declare -a ensure
ensure=( TRACKNUMBER TITLE DATE ALBUM ARTIST )
for tag_type in "${ensure[@]}"; do
album="$(basename "$final_dir")"
if [[ "$file_name" =~ ^D[0-9]+ ]]; then
disk="$(cut -d\ -f1 <<< "$file_name")"
tags[DISK]="${disk#D}"
fi
declare -a tag_ensure
tag_ensure=( TRACKNUMBER TITLE DATE ALBUM ARTIST )
for tag_type in "${tag_ensure[@]}"; do
if [[ -z "${tags[$tag_type]}" ]]; then
tags[$tag_type]="missing $tag_type"
fi