populate destinations table
This commit is contained in:
parent
c6e84b1056
commit
efe661615c
20
atom
20
atom
@ -17,6 +17,7 @@ declare -A \
|
||||
destinationcopymime \
|
||||
destinationformat \
|
||||
destinationfrequency \
|
||||
destinationid \
|
||||
destinationpath \
|
||||
destinationquality \
|
||||
destinationrename \
|
||||
@ -458,6 +459,23 @@ InsertOrUpdate() {
|
||||
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() {
|
||||
scantime=$(date +%s)
|
||||
# We probably have thousands of files, don't waste time on disk writes
|
||||
@ -609,6 +627,8 @@ done
|
||||
|
||||
openDatabase
|
||||
|
||||
createDestinations
|
||||
|
||||
getFiles
|
||||
|
||||
closeDatabase
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user