Add copy_extension

This commit is contained in:
Vincent Riquer 2020-05-07 20:40:52 +02:00
parent ed0191e450
commit b38138667a
4 changed files with 25 additions and 0 deletions

8
atom
View File

@ -634,6 +634,14 @@ do
decodeFile decodeFile
getDestDir getDestDir
getDestFile getDestFile
for copy_ext in "${destinationcopyext[@]}"
do
if [[ $filename =~ '.*\.'$copy_ext'$' ]]
then
copied=1
break
fi
done
if (( copied )) if (( copied ))
then then
copyFiles_matching copyFiles_matching

View File

@ -185,6 +185,9 @@ getConfigDestination() {
'copy_mime-type') 'copy_mime-type')
destinationcopymime[$destination]="${destinationcopymime[$destination]:+${destinationcopymime[$destination]}|}$value" destinationcopymime[$destination]="${destinationcopymime[$destination]:+${destinationcopymime[$destination]}|}$value"
;; ;;
'copy_extension')
destinationcopyext[$destination]="${destinationcopyext[$destination]:+${destinationcopyext[$destination]}|}$value"
;;
'higher-than') 'higher-than')
expr='^[0-9]*$' expr='^[0-9]*$'
if ! [[ $value =~ $expr ]] if ! [[ $value =~ $expr ]]

View File

@ -52,6 +52,9 @@ printConfig() {
| | |}" | | |}"
[ -n "${destinationcopymime["$destination"]}" ] \ [ -n "${destinationcopymime["$destination"]}" ] \
&& echo " |Copied mime-types|${destinationcopymime["$destination"]//\|/ && echo " |Copied mime-types|${destinationcopymime["$destination"]//\|/
| | |}"
[ -n "${destinationcopyext["$destination"]}" ] \
&& echo " |Copied extensions|${destinationcopyext["$destination"]//\|/
| | |}" | | |}"
done done
}|column -t -s'|' }|column -t -s'|'

View File

@ -207,6 +207,17 @@ bitrate ${destinationquality["$destination"]}
done done
cat <<-EOCfg cat <<-EOCfg
# * copy_extension <extension>: Same as skip_extension, except that files
# matching will be copied as-is to the destination.
EOCfg
destinationcopyext["$destination"]="${destinationcopyext["$destination"]}|"
while [[ ${destinationcopyext["$destination"]} =~ \| ]]
do
echo $'copy_extension\t\t'"${destinationcopyext["$destination"]%%|*}"
destinationcopyext["$destination"]="${destinationcopyext["$destination"]#*|}"
done
cat <<-EOCfg
# * channels <number>: Files with more than <number> channels will be # * channels <number>: Files with more than <number> channels will be
# downmixed. Useful if you create files for telephony music-on-hold. # downmixed. Useful if you create files for telephony music-on-hold.
EOCfg EOCfg