]> git.treefish.org Git - photosort.git/blobdiff - src/locator.py
do not re-check cached files
[photosort.git] / src / locator.py
index c19bd6c926d925689f0c5ba447d61ab3cb29f526..da74d18432175b6bdb3ec14f8cef6694603c89d0 100644 (file)
@@ -22,13 +22,7 @@ class Locator:
                   (name, size, meta_time))
         cached = c.fetchone()
         if cached:
                   (name, size, meta_time))
         cached = c.fetchone()
         if cached:
-            if os.path.isfile(cached[0]) and \
-               os.path.getsize(cached[0]) == size and \
-               misc.extract_meta_time(cached[0]) == meta_time:
-                self._update_cache_access_time(name, size, meta_time)
-                return cached[0]
-            else:
-                self._remove_from_cache(name, size, meta_time)
+            return cached[0]
         else:
             file_dir = misc.find_file(self._base_dir, name, size, meta_time,
                                       self._exclude_dir)
         else:
             file_dir = misc.find_file(self._base_dir, name, size, meta_time,
                                       self._exclude_dir)
@@ -62,7 +56,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):