populate destinations table
This commit is contained in:
parent
c6e84b1056
commit
efe661615c
20
atom
20
atom
@ -17,6 +17,7 @@ declare -A \
|
|||||||
destinationcopymime \
|
destinationcopymime \
|
||||||
destinationformat \
|
destinationformat \
|
||||||
destinationfrequency \
|
destinationfrequency \
|
||||||
|
destinationid \
|
||||||
destinationpath \
|
destinationpath \
|
||||||
destinationquality \
|
destinationquality \
|
||||||
destinationrename \
|
destinationrename \
|
||||||
@ -458,6 +459,23 @@ InsertOrUpdate() {
|
|||||||
echo "$results"
|
echo "$results"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createDestinations() {
|
||||||
|
for destination in ${!destinationpath[@]}
|
||||||
|
do
|
||||||
|
if ! [ -d "${destinationpath["$destination"]}" ]
|
||||||
|
then
|
||||||
|
if ! mkdir -p "${destinationpath["$destination"]}"
|
||||||
|
then
|
||||||
|
echo "$destination: Could not create ${destinationpath["$destination"]}!"
|
||||||
|
exit $EINVDEST
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
destinationid["$destination"]=$(
|
||||||
|
InsertIfUnset destinations <<<"name $destination"
|
||||||
|
)
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
getFiles() {
|
getFiles() {
|
||||||
scantime=$(date +%s)
|
scantime=$(date +%s)
|
||||||
# We probably have thousands of files, don't waste time on disk writes
|
# We probably have thousands of files, don't waste time on disk writes
|
||||||
@ -609,6 +627,8 @@ done
|
|||||||
|
|
||||||
openDatabase
|
openDatabase
|
||||||
|
|
||||||
|
createDestinations
|
||||||
|
|
||||||
getFiles
|
getFiles
|
||||||
|
|
||||||
closeDatabase
|
closeDatabase
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user