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