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