Implement new DB schema
This commit is contained in:
parent
4ef24fc333
commit
eba2adf2c2
12
atom
12
atom
@ -388,6 +388,8 @@ echo '
|
||||
id INTEGER PRIMARY KEY,
|
||||
key TEXT UNIQUE,
|
||||
rename_pattern TEXT,
|
||||
fat32compat INTEGER,
|
||||
ascii INTEGER,
|
||||
source_file INTEGER,
|
||||
fileid INTEGER,
|
||||
filename TEXT,
|
||||
@ -793,7 +795,9 @@ do
|
||||
WHERE destinations.name="'"$destination"'"
|
||||
AND (destination_files.rename_pattern
|
||||
!=
|
||||
"'"${destinationrenamepath[$destination]}/${destinationrename[$destination]}:${destinationfat32compat["$destination"]}"'"
|
||||
"'"${destinationrenamepath[$destination]}/${destinationrename[$destination]}"'"
|
||||
OR fat32compat != ${destinationfat32compat["$destination"]}
|
||||
OR ascii != ${destinationascii["$destination"]}
|
||||
OR destination_files.rename_pattern is NULL)
|
||||
AND destination_files.last_change > 0
|
||||
;
|
||||
@ -859,7 +863,11 @@ do
|
||||
echo "UPDATE destination_files" \
|
||||
"SET filename=\"${destfilename//\"/\"\"}\"," \
|
||||
" rename_pattern=" \
|
||||
"\"${destinationrenamepath[$destination]}/${destinationrename[$destination]}:${destinationfat32compat["$destination"]}\"" \
|
||||
"\"${destinationrenamepath[$destination]}/${destinationrename[$destination]}" \
|
||||
" fat32compat="
|
||||
"${destinationfat32compat["$destination"]}\"" \
|
||||
" ascii=" \
|
||||
"${destinationascii["$destination"]}" \
|
||||
"WHERE id=$destfileid;" \
|
||||
>&3
|
||||
if (( commit ))
|
||||
|
||||
@ -74,7 +74,9 @@ copyFiles_action() {
|
||||
then
|
||||
Update destination_files \
|
||||
filename "$destdir/${sourcefilename##*/}"\
|
||||
rename_pattern "${destinationrenamepath[$destination]}/${destinationrename[$destination]}:${destinationfat32compat["$destination"]}"\
|
||||
rename_pattern "${destinationrenamepath[$destination]}/${destinationrename[$destination]}"\
|
||||
fat32compat ${destinationfat32compat["$destination"]}\
|
||||
ascii ${destinationascii["$destination"]}\
|
||||
last_change $lastchange \
|
||||
<<-EOWhere
|
||||
id = $destfileid
|
||||
|
||||
@ -22,8 +22,11 @@ copyFiles_matching() {
|
||||
" FROM destination_files" \
|
||||
" WHERE id=$destfileid" \
|
||||
" )," \
|
||||
" rename_pattern=" \
|
||||
"\"${destinationrenamepath[$destination]}/${destinationrename[$destination]}:${destinationfat32compat["$destination"]}\""\
|
||||
" rename_pattern" \
|
||||
"\"${destinationrenamepath[$destination]}/${destinationrename[$destination]}\""\
|
||||
" fat32compat" \
|
||||
" ${destinationfat32compat["$destination"]}"\
|
||||
" ascii ${destinationascii["$destination"]}"\
|
||||
"WHERE id=$destfileid;" \
|
||||
>&3
|
||||
(( ++copies ))
|
||||
|
||||
@ -65,7 +65,9 @@ encodeFile::mp3() {
|
||||
cleanup $tempdir/$tmpfile.wav
|
||||
source_file $fileid
|
||||
status 0
|
||||
rename_pattern ${destinationrenamepath[$destination]}/${destinationrename[$destination]}:${destinationfat32compat["$destination"]}
|
||||
rename_pattern ${destinationrenamepath[$destination]}/${destinationrename[$destination]}
|
||||
fat32compat ${destinationfat32compat["$destination"]}
|
||||
ascii ${destinationascii["$destination"]}
|
||||
EOInsert
|
||||
)
|
||||
progressSpin
|
||||
|
||||
@ -37,7 +37,9 @@ encodeFile::opus() {
|
||||
cleanup $tempdir/$tmpfile.wav
|
||||
source_file $fileid
|
||||
status 0
|
||||
rename_pattern ${destinationrenamepath[$destination]}/${destinationrename[$destination]}:${destinationfat32compat["$destination"]}
|
||||
rename_pattern ${destinationrenamepath[$destination]}/${destinationrename[$destination]}
|
||||
fat32compat ${destinationfat32compat["$destination"]}
|
||||
ascii ${destinationascii["$destination"]}
|
||||
EOInsert
|
||||
)
|
||||
progressSpin
|
||||
|
||||
@ -33,7 +33,9 @@ encodeFile::vorbis() {
|
||||
cleanup $tempdir/$tmpfile.wav
|
||||
source_file $fileid
|
||||
status 0
|
||||
rename_pattern ${destinationrenamepath[$destination]}/${destinationrename[$destination]}:${destinationfat32compat["$destination"]}
|
||||
rename_pattern ${destinationrenamepath[$destination]}/${destinationrename[$destination]}
|
||||
fat32compat ${destinationfat32compat["$destination"]}
|
||||
ascii ${destinationascii["$destination"]}
|
||||
EOInsert
|
||||
)
|
||||
progressSpin
|
||||
|
||||
@ -47,6 +47,16 @@ cleaner() {
|
||||
" SELECT rename_pattern" \
|
||||
" FROM tasks" \
|
||||
" WHERE id=$taskid" \
|
||||
" )," \
|
||||
" fat32compat=(" \
|
||||
" SELECT fat32compat" \
|
||||
" FROM tasks" \
|
||||
" WHERE id=$taskid" \
|
||||
" )," \
|
||||
" ascii=(" \
|
||||
" SELECT ascii" \
|
||||
" FROM tasks" \
|
||||
" WHERE id=$taskid" \
|
||||
" )" \
|
||||
"WHERE id=$destfileid;" \
|
||||
>&3
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user