From db3a30e54d542cd28adfc4d599e4eac9e5d4f2c9 Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Tue, 5 Mar 2013 13:24:06 +0100 Subject: [PATCH] only select files with tag cache empty or obsolete --- atom | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/atom b/atom index f20a74a..932e718 100755 --- a/atom +++ b/atom @@ -763,32 +763,39 @@ removeObsoleteFiles # get files echo ' - SELECT COUNT(*) + SELECT COUNT(DISTINCT source_files.filename) FROM source_files, destinations, destination_files, - mime_type_actions + mime_type_actions, + tags 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 source_files.id = tags.source_file + AND tags.last_change < source_files.last_change AND mime_type_actions.action = 1;' >&3 read -u4 filecount echo ' - SELECT - destinations.name, + SELECT DISTINCT + source_files.id, + source_files.last_change, mime_type_actions.mime_text, source_files.filename FROM source_files, destinations, destination_files, - mime_type_actions + mime_type_actions, + tags 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 source_files.id = tags.source_file + AND tags.last_change < source_files.last_change AND mime_type_actions.action = 1; SELECT "AtOM:NoMoreFiles";' >&3