Regen files on key parameters' change
This commit is contained in:
parent
2fbeba3295
commit
13734a0f1d
2
atom
2
atom
@ -343,7 +343,7 @@ do
|
||||
then
|
||||
echo "Resetting destination files timestamps on" \
|
||||
"$forcedest ($forcedestid)..."
|
||||
Update destination_files last_change 1 \
|
||||
Update destination_files last_change 0 \
|
||||
<<<"destination_id = $forcedestid"
|
||||
else
|
||||
echo "Destination $forcedest does not exist!" >&2
|
||||
|
||||
@ -65,6 +65,11 @@ setupDestination() {
|
||||
fi
|
||||
}
|
||||
comeagain
|
||||
if [ -n "${destinationquality["$destination"]}" ] \
|
||||
&& (( value != ${destinationquality["$destination"]} ))
|
||||
then
|
||||
setupRegen quality
|
||||
fi
|
||||
destinationquality["$destination"]=$value
|
||||
;;
|
||||
opus)
|
||||
@ -90,6 +95,11 @@ setupDestination() {
|
||||
fi
|
||||
}
|
||||
comeagain
|
||||
if [ -n "${destinationquality["$destination"]}" ] \
|
||||
&& (( value != ${destinationquality["$destination"]} ))
|
||||
then
|
||||
setupRegen bitrate
|
||||
fi
|
||||
destinationquality["$destination"]=$value
|
||||
cat <<-EODesc
|
||||
|
||||
@ -112,6 +122,11 @@ setupDestination() {
|
||||
fi
|
||||
}
|
||||
comeagain
|
||||
if [ -n "${destinationloss["$destination"]}" ] \
|
||||
&& (( value != ${destinationloss["$destination"]} ))
|
||||
then
|
||||
setupRegen loss
|
||||
fi
|
||||
destinationloss["$destination"]=$value
|
||||
;;
|
||||
mp3)
|
||||
@ -135,6 +150,11 @@ setupDestination() {
|
||||
fi
|
||||
}
|
||||
comeagain
|
||||
if [ -n "${destinationquality["$destination"]}" ] \
|
||||
&& (( value != ${destinationquality["$destination"]} ))
|
||||
then
|
||||
setupRegen bitrate
|
||||
fi
|
||||
destinationquality["$destination"]=$value
|
||||
cat <<-EODesc
|
||||
|
||||
@ -156,9 +176,13 @@ setupDestination() {
|
||||
value
|
||||
case $value in
|
||||
[yY])
|
||||
[[ $initialvalue == n ]]\
|
||||
&& setupRegen noresample
|
||||
destinationnoresample["$destination"]=1
|
||||
;;
|
||||
''|[nN])
|
||||
[[ $initialvalue == y ]]\
|
||||
&& setupRegen noresample
|
||||
destinationnoresample["$destination"]=0
|
||||
;;
|
||||
*)
|
||||
@ -193,9 +217,13 @@ setupDestination() {
|
||||
value
|
||||
case $value in
|
||||
[yY])
|
||||
[[ $initialvalue == n ]] \
|
||||
&& setupRegen normalize
|
||||
destinationnormalize["$destination"]=1
|
||||
;;
|
||||
''|[nN])
|
||||
[[ $initialvalue == y ]] \
|
||||
&& setupRegen normalize
|
||||
destinationnormalize["$destination"]=0
|
||||
;;
|
||||
*)
|
||||
@ -355,6 +383,11 @@ setupDestination() {
|
||||
fi
|
||||
}
|
||||
comeagain
|
||||
if [ -n "${destinationchannels["$destination"]}" ] \
|
||||
&& (( value != ${destinationchannels["$destination"]} ))
|
||||
then
|
||||
setupRegen channels
|
||||
fi
|
||||
destinationchannels["$destination"]=$value
|
||||
cat <<-EODesc
|
||||
|
||||
@ -387,6 +420,11 @@ setupDestination() {
|
||||
unset expr
|
||||
}
|
||||
comeagain
|
||||
if [ -n "${destinationfrequency["$destination"]}" ] \
|
||||
&& (( value != ${destinationfrequency["$destination"]} ))
|
||||
then
|
||||
setupRegen frequency
|
||||
fi
|
||||
destinationfrequency["$destination"]=$value
|
||||
cat <<-EODesc
|
||||
|
||||
@ -413,5 +451,11 @@ setupDestination() {
|
||||
fi
|
||||
}
|
||||
comeagain
|
||||
if [ -n "${destinationmaxbps["$destination"]}" ] \
|
||||
&& (( value != ${destinationmaxbps["$destination"]} ))
|
||||
then
|
||||
setupRegen maxbps
|
||||
fi
|
||||
destinationmaxbps[$destination]="$value"
|
||||
unset regen
|
||||
}
|
||||
|
||||
28
lib/setup/regen
Normal file
28
lib/setup/regen
Normal file
@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
setupRegen() {
|
||||
(( regen )) && return 0
|
||||
echo "Parameter $1 for destination $destination changed."
|
||||
read -p'Regenerate all files? [y/n] '
|
||||
case $REPLY in
|
||||
y)
|
||||
regen=1
|
||||
openDatabase
|
||||
if forcedestid=$(Select destinations id <<<"name = $destination")
|
||||
then
|
||||
echo "Resetting destination files timestamps on" \
|
||||
"$destination ($forcedestid)..."
|
||||
Update destination_files last_change 0 \
|
||||
<<<"destination_id = $forcedestid"
|
||||
else
|
||||
echo "Destination $destination does not exist!" >&2
|
||||
fi
|
||||
closeDatabase
|
||||
;;
|
||||
n)
|
||||
;;
|
||||
*)
|
||||
setupRegen $1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user