From b5bc63617868fd5dd796ed6351d290e818cb13d4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 21 Jul 2013 11:50:20 +0530 Subject: [PATCH] Fix queueing of all dirtied books --- src/calibre/db/legacy.py | 5 ++++- src/calibre/db/tests/legacy.py | 2 +- src/calibre/gui2/actions/choose_library.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/calibre/db/legacy.py b/src/calibre/db/legacy.py index 13edf47999..5d41986fce 100644 --- a/src/calibre/db/legacy.py +++ b/src/calibre/db/legacy.py @@ -323,7 +323,10 @@ class LibraryDatabase(object): self.notify('delete', [id]) def dirtied(self, book_ids, commit=True): - self.new_api.mark_as_dirty(book_ids) + self.new_api.mark_as_dirty(frozenset(book_ids) if book_ids is not None else book_ids) + + def dirty_queue_length(self): + return self.new_api.dirty_queue_length() def dump_metadata(self, book_ids=None, remove_from_dirtied=True, commit=True, callback=None): self.new_api.dump_metadata(book_ids=book_ids, remove_from_dirtied=remove_from_dirtied, callback=callback) diff --git a/src/calibre/db/tests/legacy.py b/src/calibre/db/tests/legacy.py index f9caa7a304..a5f5f693fe 100644 --- a/src/calibre/db/tests/legacy.py +++ b/src/calibre/db/tests/legacy.py @@ -398,7 +398,7 @@ class LegacyTest(BaseTest): 'clean_user_categories', 'cleanup_tags', 'books_list_filter', 'conn', 'connect', 'construct_file_name', 'construct_path_name', 'clear_dirtied', 'initialize_database', 'initialize_dynamic', 'run_import_plugins', 'vacuum', 'set_path', 'row', 'row_factory', 'rows', 'rmtree', 'series_index_pat', - 'import_old_database', 'dirtied_lock', 'dirtied_cache', 'dirty_queue_length', 'dirty_books_referencing', + 'import_old_database', 'dirtied_lock', 'dirtied_cache', 'dirty_books_referencing', 'windows_check_if_files_in_use', 'get_metadata_for_dump', 'get_a_dirtied_book', 'dirtied_sequence', 'format_filename_cache', 'format_metadata_cache', 'filter', 'create_version1', 'normpath', 'custom_data_adapters', 'custom_table_names', 'custom_columns_in_meta', 'custom_tables', diff --git a/src/calibre/gui2/actions/choose_library.py b/src/calibre/gui2/actions/choose_library.py index f85eb09f37..4010847109 100644 --- a/src/calibre/gui2/actions/choose_library.py +++ b/src/calibre/gui2/actions/choose_library.py @@ -376,7 +376,7 @@ class ChooseLibraryAction(InterfaceAction): dirty_text = 'no' try: dirty_text = \ - unicode(self.gui.library_view.model().db.dirty_queue_length()) + unicode(self.gui.current_db.dirty_queue_length()) except: dirty_text = _('none') info_dialog(self.gui, _('Backup status'), '

'+