summaryrefslogtreecommitdiff
path: root/src/db/PhotoTable.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-01-21 19:17:10 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-01-21 19:17:10 +0100
commita7ff7c49085c320c1e0a2ffb66cc6d283c5acb8e (patch)
treed9f86def771c7845f241ec81219b243c70523c60 /src/db/PhotoTable.vala
parent66f6a7bd3f7e00022191f16cb0e82a39e7333a76 (diff)
New upstream version 0.25.3upstream/0.25.3
Diffstat (limited to 'src/db/PhotoTable.vala')
-rw-r--r--src/db/PhotoTable.vala13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/db/PhotoTable.vala b/src/db/PhotoTable.vala
index 4304da8..24cec86 100644
--- a/src/db/PhotoTable.vala
+++ b/src/db/PhotoTable.vala
@@ -920,14 +920,15 @@ public class PhotoTable : DatabaseTable {
sql += " OR ((";
first = false;
- if (thumbnail_md5 != null)
- sql += " thumbnail_md5=?";
-
if (md5 != null) {
- if (thumbnail_md5 == null)
- sql += " md5=?";
+ sql += " md5=?";
+
+ }
+ if (thumbnail_md5 != null) {
+ if (md5 == null)
+ sql += " thumbnail_md5=?";
else
- sql += " OR md5=?";
+ sql += " OR (md5 IS NULL AND thumbnail_md5=?)";
}
sql += ")";