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:19:04 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-01-21 19:19:04 +0100
commitf39ea21098340bd99c48669f152c9068046c2c99 (patch)
treed1166fce1a4a8c470dfaf364816f767678c4729e /src/db/PhotoTable.vala
parentbc48a4cff815ed156b603c92e684779c317417ba (diff)
parenta7ff7c49085c320c1e0a2ffb66cc6d283c5acb8e (diff)
Merge tag 'upstream/0.25.3'
Upstream version 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 += ")";