From bb782d18b93c256fe0cdb173a2df9a103e1fc24f Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 8 May 2021 18:25:12 -0700 Subject: [PATCH] Add a little defense against mtime == 0. --- etiquette/photodb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etiquette/photodb.py b/etiquette/photodb.py index 3e7c82b..c394f7d 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -1639,7 +1639,7 @@ class PDBUtilMixin: a file that's already in the database. ''' same_meta = self.get_photos_by_sql( - 'SELECT * FROM photos WHERE mtime == ? AND bytes == ?', + 'SELECT * FROM photos WHERE mtime != 0 AND mtime == ? AND bytes == ?', [filepath.stat.st_mtime, filepath.stat.st_size] ) same_meta = [photo for photo in same_meta if not photo.real_path.is_file]