diff --git a/src/calibre/db/__init__.py b/src/calibre/db/__init__.py index 3a14552281..99154ad618 100644 --- a/src/calibre/db/__init__.py +++ b/src/calibre/db/__init__.py @@ -112,10 +112,6 @@ Various things that require other things before they can be migrated: libraries/switching/on calibre startup. 3. Port library/restore.py 4. Replace the metadatabackup thread with the new implementation when using the new backend. - 5. In the new API refresh() does not re-read from disk. That might break a - few things, for example content server reloading on db change as well as - dump/restore of db and the refreshdb: action in gui2/ui.py. Probaly you'll have to create a dedicated API for - refreshing the db from disk and change the code to use it instead of the overloaded refresh (which is often used - to reread data from the db after writing to it). See reload_from_db() in cache.py - 6. grep the sources for TODO + 5. grep the sources for TODO + 6. Check that content server reloading on metadata,db change, metadata backup, refresh gui on calibredb add all work ''' diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index 06cb4d904f..229ed0933d 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -532,7 +532,12 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{ self.raise_() self.activateWindow() elif msg.startswith('refreshdb:'): - self.library_view.model().refresh() + db = self.library_view.model().db + if hasattr(db, 'new_api'): + db.new_api.reload_from_db() + self.library_view.model().resort() + else: + self.library_view.model().refresh() self.library_view.model().research() self.tags_view.recount() self.library_view.model().db.refresh_format_cache()