From bed67cc8f6a144a975d8eee01ada0468b5cf937d Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Sun, 3 Mar 2013 21:16:24 +0100 Subject: [PATCH] tags scanning progress --- atom | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/atom b/atom index eec385c..f932d75 100755 --- a/atom +++ b/atom @@ -586,6 +586,7 @@ getFiles() { ) echo 'COMMIT;' >&3 echo -e "\r$count files found, ${new:=0} new or changed." + unset count } updateMimes() { @@ -760,6 +761,19 @@ updateMimes removeObsoleteFiles # get files +echo ' + SELECT COUNT(*) + FROM source_files, + destinations, + destination_files, + mime_type_actions + WHERE destination_files.last_change < source_files.last_change + AND destinations.id = destination_files.destination_id + AND mime_type_actions.destination_id = destinations.id + AND mime_type_actions.id = source_files.mime_type + AND source_files.id = destination_files.source_file_id + AND mime_type_actions.action = 1;' >&3 +read -u4 filecount echo ' SELECT destinations.name, @@ -781,16 +795,19 @@ while read -u4 line do if [[ $line = AtOM:NoMoreFiles ]] then + echo -e "\r$count files to create or update." break else destination=${line%%|*} rest=${line#*|} mimetype=${rest%%|*} filename=${rest#*|} + echo -en "\rTags: $((++count*100/filecount))%" getTags #createTask fi done +unset count closeDatabase # vim:set ts=8 sw=8: