Changes uncomitted in previous merge
This commit is contained in:
commit
dc23c37c06
26
atom
26
atom
@ -539,15 +539,29 @@ getFiles() {
|
|||||||
echo 'BEGIN TRANSACTION;' >&3
|
echo 'BEGIN TRANSACTION;' >&3
|
||||||
while read time size filename
|
while read time size filename
|
||||||
do
|
do
|
||||||
sourcefileid=$(
|
if ! Select source_files id >/dev/null <<-EOWhere
|
||||||
|
filename = $filename
|
||||||
|
mime_type > 0
|
||||||
|
last_change >= $time
|
||||||
|
EOWhere
|
||||||
|
then
|
||||||
|
mimetype=$(file -b --mime-type "$sourcepath/$filename")
|
||||||
|
mimetypeid=$(
|
||||||
|
InsertIfUnset mime_types <<-EOInsert
|
||||||
|
mime_text $mimetype
|
||||||
|
EOInsert
|
||||||
|
)
|
||||||
InsertOrUpdate source_files \
|
InsertOrUpdate source_files \
|
||||||
last_change ${time%.*} \
|
last_change $time \
|
||||||
size $size \
|
size $size \
|
||||||
last_seen $scantime \
|
last_seen $scantime \
|
||||||
|
mime_type $mimetypeid \
|
||||||
|
>/dev/null \
|
||||||
<<-EOWhere
|
<<-EOWhere
|
||||||
filename $filename
|
filename $filename
|
||||||
EOWhere
|
EOWhere
|
||||||
)
|
(( ++new ))
|
||||||
|
fi
|
||||||
case $(( ++count % 4 )) in
|
case $(( ++count % 4 )) in
|
||||||
0) echo -ne '\r|' ;;
|
0) echo -ne '\r|' ;;
|
||||||
1) echo -ne '\r/' ;;
|
1) echo -ne '\r/' ;;
|
||||||
@ -558,7 +572,7 @@ getFiles() {
|
|||||||
find "$sourcepath" -type f -printf "%T@ %s %P\n"
|
find "$sourcepath" -type f -printf "%T@ %s %P\n"
|
||||||
)
|
)
|
||||||
echo 'COMMIT;' >&3
|
echo 'COMMIT;' >&3
|
||||||
echo -e "\r$count files found."
|
echo -e "\r$count files found, ${new:=0} new or changed."
|
||||||
}
|
}
|
||||||
|
|
||||||
updateMimes() {
|
updateMimes() {
|
||||||
@ -572,7 +586,7 @@ updateMimes() {
|
|||||||
Update mime_type_actions action 0 >/dev/null < <(
|
Update mime_type_actions action 0 >/dev/null < <(
|
||||||
cat <<-EOWhere
|
cat <<-EOWhere
|
||||||
destination_id = ${destinationid["$destination"]}
|
destination_id = ${destinationid["$destination"]}
|
||||||
mime_text LIKE ${mime_type//*/%}
|
mime_text LIKE ${mime_type//\*/%}
|
||||||
EOWhere
|
EOWhere
|
||||||
)
|
)
|
||||||
done
|
done
|
||||||
@ -586,7 +600,7 @@ updateMimes() {
|
|||||||
Update mime_type_actions action 2 >/dev/null < <(
|
Update mime_type_actions action 2 >/dev/null < <(
|
||||||
cat <<-EOWhere
|
cat <<-EOWhere
|
||||||
destination_id = ${destinationid["$destination"]}
|
destination_id = ${destinationid["$destination"]}
|
||||||
mime_text LIKE ${mime_type//*/%}
|
mime_text LIKE ${mime_type//\*/%}
|
||||||
EOWhere
|
EOWhere
|
||||||
)
|
)
|
||||||
done
|
done
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user