]> git.treefish.org Git - photosort.git/blobdiff - src/locator.py
fixing clean cache statement
[photosort.git] / src / locator.py
index ff74e0c8d894adf43e3fd11e4513943333db7a75..3b866f8550e6d65f39b15aeb5c8b234dedcad42d 100644 (file)
@@ -30,7 +30,8 @@ class Locator:
             else:
                 self._remove_from_cache(name, size, meta_time)
         else:
             else:
                 self._remove_from_cache(name, size, meta_time)
         else:
-            file_dir = misc.find_file(name, size, meta_time)
+            file_dir = misc.find_file(self._base_dir, name, size, meta_time,
+                                      self._exclude_dir)
             if file_dir:
                 self._clean_cache()
                 self._add_to_cache(name, size, meta_time, file_dir)
             if file_dir:
                 self._clean_cache()
                 self._add_to_cache(name, size, meta_time, file_dir)
@@ -61,7 +62,7 @@ class Locator:
 
     def _clean_cache(self):
         c = self._conn.cursor()
 
     def _clean_cache(self):
         c = self._conn.cursor()
-        c.execute("DELETE FROM cache WHERE access_time<?", (int(time.time()) - 604800))
+        c.execute("DELETE FROM cache WHERE access_time<?", (int(time.time()) - 604800,))
         self._conn.commit()
 
     def _create_db(self):
         self._conn.commit()
 
     def _create_db(self):