From 46a43828e4922ceb461addba3eac22ac583c864d Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Wed, 19 Jun 2013 02:35:27 +0200 Subject: [PATCH] setup/destination: higher-than --- lib/setup/setupDestination | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/setup/setupDestination b/lib/setup/setupDestination index e618841..bd3c152 100644 --- a/lib/setup/setupDestination +++ b/lib/setup/setupDestination @@ -386,9 +386,29 @@ setupDestination() { comeagain destinationfrequency["$destination"]=$value cat <<-EODesc + + Higher-Than (bitrate, integer): + Only reencode files with bitrates higher then kbps. This + only applies if sample-rate, channel count and of course format are + equal. If unset, only files with bitrates equal to that of the + target will be copied (actually, hardlinking will be attempted + first). + + As Ogg Vorbis target quality is not defined by its bitrate, Ogg + Vorbis files will always be reencoded if unset. EODesc comeagain() { - : + read \ + -e \ + ${destinationmaxbps["$destination"]+-i${destinationmaxbps["$destination"]}}\ + -p'Higher-Than: ' \ + value + if ! [[ $value =~ $expr ]] + then + echo "Invalid higher-than bitrate value: $value" >&2 + comeagain + fi } comeagain + destinationmaxbps[$destination]="$value" }