diff --git a/src/calibre/db/cache.py b/src/calibre/db/cache.py index 7bdf425507..389fce7d59 100644 --- a/src/calibre/db/cache.py +++ b/src/calibre/db/cache.py @@ -107,6 +107,7 @@ class Cache(object): self.dirtied_cache = {} self.dirtied_sequence = 0 self.cover_caches = set() + self.clear_search_cache_count = 0 # Implement locking for all simple read/write API methods # An unlocked version of the method is stored with the name starting @@ -189,8 +190,13 @@ class Cache(object): @write_api def clear_search_caches(self, book_ids=None): + self.clear_search_cache_count += 1 self._search_api.update_or_clear(self, book_ids) + @read_api + def last_modified(self): + return self.backend.last_modified() + @write_api def clear_caches(self, book_ids=None, template_cache=True, search_cache=True): if template_cache: diff --git a/src/calibre/db/legacy.py b/src/calibre/db/legacy.py index 83cc8c60dc..2be12f9653 100644 --- a/src/calibre/db/legacy.py +++ b/src/calibre/db/legacy.py @@ -121,7 +121,7 @@ class LibraryDatabase(object): return self.backend.dbpath def last_modified(self): - return self.backend.last_modified() + return self.new_api.last_modified() def check_if_modified(self): if self.last_modified() > self.last_update_check: