From 9c2f765f5c95d67e6f2f1c20a1079df4c1873b31 Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Thu, 2 May 2013 03:40:24 +0200 Subject: [PATCH] toys/missingtags: skip text and image files --- toys/missingtags | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/toys/missingtags b/toys/missingtags index ab73d1b..780b475 100755 --- a/toys/missingtags +++ b/toys/missingtags @@ -99,10 +99,10 @@ for check in ${!checks[@]} do case $check in tracktotal) - whereclause+="${whereclause+ OR }NOT tags.track LIKE \"%/%\"" + whereclause+="${whereclause+OR }NOT tags.track LIKE \"%/%\"" ;; *) - whereclause+="${whereclause+ OR }tags.$check IS NULL" + whereclause+="${whereclause+OR }tags.$check IS NULL" ;; esac whereclause+=' @@ -124,8 +124,15 @@ cat >&3 <<-EOSelect FROM tags INNER JOIN source_files ON tags.source_file=source_files.id - WHERE $whereclause - AND NOT tags.tagreader LIKE "unknown-%"; + INNER JOIN mime_types + ON source_files.mime_type=mime_types.id + WHERE ( + $whereclause + ) + AND NOT tags.tagreader LIKE "unknown-%" + AND NOT mime_types.mime_text LIKE "text/%" + AND NOT mime_types.mime_text LIKE "image/%" + ; SELECT "AtOM:NoMoreFiles"; EOSelect