Add track totals

This commit is contained in:
Vincent Riquer 2013-10-06 03:07:49 +02:00
parent 29bf28f51d
commit e08ee9ad7e

View File

@ -60,6 +60,7 @@ do
'-g') show+=(genres) ;;
'-m') show+=(oldtimestamp) ;;
'-M') show+=(types) ;;
'-N') show+=(tracktotals) ;;
'-p') show+=(performers) ;;
'-s') show+=(rates) ;;
'-B') show+=(depths) ;;
@ -100,6 +101,7 @@ done
-d Disc
-g Genre
-p Performer
-N Track total
-t Title
-y Year
@ -241,6 +243,7 @@ do
performers) info='Performer' ;;
rates) info='Sample rate' ;;
titles) info='Title' ;;
tracktotals) info='Track total' ;;
years) info='Date' ;;
esac
printtmp="${info:0:$locallength}"
@ -271,6 +274,7 @@ SELECT
tags.genre,
tags.performer,
tags.title,
tags.track,
tags.year
FROM source_files
INNER JOIN mime_types
@ -327,6 +331,9 @@ do
rest="${rest#*::AtOM:SQL:Sep::}"
title="${rest%%::AtOM:SQL:Sep::*}"
rest="${rest#*::AtOM:SQL:Sep::}"
track="${rest%%::AtOM:SQL:Sep::*}"
tracktotal=${track#*/}
rest="${rest#*::AtOM:SQL:Sep::}"
year="${rest%%::AtOM:SQL:Sep::*}"
rest="${rest#*::AtOM:SQL:Sep::}"
case $mimetype in
@ -450,6 +457,13 @@ do
[ -n "$title" ] \
&& titles+="${titles+,}$title"
fi
if ! [[ $tracktotals =~ $expr1"$tracktotal"$expr2 ]]
then
[ -z "$tracktotals" ] \
&& unset tracktotals
[ -n "$tracktotal" ] \
&& tracktotals+="${tracktotals+,}$tracktotal"
fi
if ! [[ $years =~ $expr1"$year"$expr2 ]]
then
[ -z "$years" ] \
@ -475,6 +489,7 @@ do
genres="$genre"
performers="$performer"
titles="$title"
tracktotals="$tracktotal"
years="$year"
count=1
(( bitrate )) && (( bitrates=bitrate ))