mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
newdb: Fix reloading of content server on metadata.db change
This commit is contained in:
parent
179c28e328
commit
9ae9cf219e
@ -137,7 +137,7 @@ def get_db_loader():
|
||||
|
||||
'''
|
||||
Various things that require other things before they can be migrated:
|
||||
1. Check that content server reloading on metadata,db change, metadata
|
||||
1. Check that metadata
|
||||
backup, refresh gui on calibredb add and moving libraries all work (check
|
||||
them on windows as well for file locking issues)
|
||||
'''
|
||||
|
@ -120,6 +120,7 @@ class LibraryDatabase(object):
|
||||
if self.last_modified() > self.last_update_check:
|
||||
self.backend.reopen()
|
||||
self.new_api.reload_from_db()
|
||||
self.data.refresh(clear_caches=False) # caches are already cleared by reload_from_db()
|
||||
self.last_update_check = utcnow()
|
||||
|
||||
@property
|
||||
|
@ -322,10 +322,11 @@ class View(object):
|
||||
# be shared by multiple views. This is not ideal, but...
|
||||
self.cache.clear_search_caches(old_marked_ids | set(self.marked_ids))
|
||||
|
||||
def refresh(self, field=None, ascending=True):
|
||||
def refresh(self, field=None, ascending=True, clear_caches=True):
|
||||
self._map = tuple(self.cache.all_book_ids())
|
||||
self._map_filtered = tuple(self._map)
|
||||
self.cache.clear_caches()
|
||||
if clear_caches:
|
||||
self.cache.clear_caches()
|
||||
if field is not None:
|
||||
self.sort(field, ascending)
|
||||
if self.search_restriction or self.base_restriction:
|
||||
|
Loading…
x
Reference in New Issue
Block a user