Allow disabling destinations
This commit is contained in:
parent
dcf158a5a2
commit
ed0191e450
17
atom
17
atom
@ -13,6 +13,7 @@ EFMTINVPARM=49
|
||||
|
||||
# config structures
|
||||
declare -A \
|
||||
destinationenabled \
|
||||
destinationascii \
|
||||
destinationchannels \
|
||||
destinationfat32compat \
|
||||
@ -330,6 +331,16 @@ fi
|
||||
|
||||
openDatabase
|
||||
|
||||
for destination in "${!destinationpath[@]}"
|
||||
do
|
||||
if (( ${destinationenabled["$destination"]} ))
|
||||
then
|
||||
Update destinations enabled 1 <<<"name = $destination"
|
||||
else
|
||||
Update destinations enabled 0 <<<"name = $destination"
|
||||
fi
|
||||
done
|
||||
|
||||
createDestinations
|
||||
|
||||
getFiles
|
||||
@ -513,7 +524,8 @@ echo '
|
||||
ON mime_type_actions.id = source_files.mime_type
|
||||
INNER JOIN tags
|
||||
ON source_files.id = tags.source_file
|
||||
WHERE CAST(destination_files.last_change AS TEXT)
|
||||
WHERE destinations.enabled = 1
|
||||
AND CAST(destination_files.last_change AS TEXT)
|
||||
<> CAST(source_files.last_change AS TEXT)
|
||||
AND mime_type_actions.destination_id = destinations.id
|
||||
AND mime_type_actions.action = 1;' >&3
|
||||
@ -554,7 +566,8 @@ echo '
|
||||
ON mime_type_actions.id = source_files.mime_type
|
||||
INNER JOIN tags
|
||||
ON source_files.id = tags.source_file
|
||||
WHERE CAST(destination_files.last_change AS TEXT)
|
||||
WHERE destinations.enabled = 1
|
||||
AND CAST(destination_files.last_change AS TEXT)
|
||||
<> CAST(source_files.last_change AS TEXT)
|
||||
AND mime_type_actions.destination_id = destinations.id
|
||||
AND mime_type_actions.action = 1
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
#!/bin/bash
|
||||
getConfigDestination() {
|
||||
case "$key" in
|
||||
'enabled')
|
||||
destinationenabled["$destination"]="$value"
|
||||
;;
|
||||
'path')
|
||||
destinationpath["$destination"]="$value"
|
||||
;;
|
||||
|
||||
@ -26,6 +26,7 @@ printConfig() {
|
||||
cat <<-EOF
|
||||
|
||||
$destination|Path|${destinationpath["$destination"]}
|
||||
|Enabled|${destinationenabled["$destination"]}
|
||||
|Format|${destinationformat["$destination"]}
|
||||
|Quality|${destinationquality["$destination"]}
|
||||
EOF
|
||||
|
||||
@ -60,6 +60,9 @@ path $sourcepath
|
||||
|
||||
# Common parameters:
|
||||
# Mandatory parameters:
|
||||
# * enabled: Whether or not to treat this destination (1=tue/0=false)
|
||||
enabled 1
|
||||
|
||||
# * path: Where files will be written
|
||||
path ${destinationpath["$destination"]}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
currentdbversion=2
|
||||
currentdbversion=3
|
||||
checkDatabaseVersion() {
|
||||
local dbversion
|
||||
if dbversion=$(Select atom version <<<"\"1\" = 1")
|
||||
|
||||
14
lib/database/upgradedatabase_2_3
Normal file
14
lib/database/upgradedatabase_2_3
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
upgradedatabase_2_3() {
|
||||
local data \
|
||||
datas \
|
||||
id \
|
||||
destination
|
||||
echo "Upgrading database to version 3... (backup is $database.bak_v2)"
|
||||
cp "$database" "$database.bak_v2"
|
||||
echo 'ALTER TABLE destinations ADD COLUMN enabled INTEGER DEFAULT 1;' >&3
|
||||
Update destinations enabled 1 <<< "1 = 1"
|
||||
|
||||
Update atom version 3 <<<"1 = 1"
|
||||
}
|
||||
@ -11,7 +11,7 @@ createDestinations() {
|
||||
fi
|
||||
fi
|
||||
destinationid["$destination"]=$(
|
||||
InsertIfUnset destinations <<<"name $destination"
|
||||
InsertIfUnset destinations <<<"name $destination ${destinationenabled[\"$destination\"]}"
|
||||
)
|
||||
done
|
||||
}
|
||||
|
||||
@ -5,10 +5,10 @@ progressSpin() {
|
||||
(( ++count ))
|
||||
else
|
||||
case $(( ++count % 40 )) in
|
||||
0) echo -ne $count '\b|' ;;
|
||||
10) echo -ne $count '\b/' ;;
|
||||
20) echo -en $count '\b-' ;;
|
||||
30) echo -ne $count '\b\\' ;;
|
||||
0) echo -n $'\b|' ;;
|
||||
10) echo -n $'\b/' ;;
|
||||
20) echo -n $'\b-' ;;
|
||||
30) echo -n $'\b\\' ;;
|
||||
*) ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user