mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Accidentally ignored commit_dirty_cache()
This commit is contained in:
parent
f0ef5f0387
commit
f2f411f939
@ -800,6 +800,12 @@ class Cache(object):
|
||||
self.dirtied_sequence = max(new_dirtied.itervalues()) + 1
|
||||
self.dirtied_cache.update(new_dirtied)
|
||||
|
||||
@write_api
|
||||
def commit_dirty_cache(self):
|
||||
book_ids = [(x,) for x in self.dirtied_cache]
|
||||
if book_ids:
|
||||
self.backend.conn.executemany('INSERT OR IGNORE INTO metadata_dirtied (book) VALUES (?)', book_ids)
|
||||
|
||||
@write_api
|
||||
def set_field(self, name, book_id_to_val_map, allow_case_change=True, do_path_update=True):
|
||||
f = self.fields[name]
|
||||
|
@ -890,6 +890,7 @@ LibraryDatabase.saved_search_set_all = MT(lambda self, smap:self.new_api.saved_s
|
||||
LibraryDatabase.saved_search_delete = MT(lambda self, x:self.new_api.saved_search_delete(x))
|
||||
LibraryDatabase.saved_search_add = MT(lambda self, x, y:self.new_api.saved_search_add(x, y))
|
||||
LibraryDatabase.saved_search_rename = MT(lambda self, x, y:self.new_api.saved_search_rename(x, y))
|
||||
LibraryDatabase.commit_dirty_cache = MT(lambda self: self.new_api.commit_dirty_cache())
|
||||
# Cleaning is not required anymore
|
||||
LibraryDatabase.clean = LibraryDatabase.clean_custom = MT(lambda self:None)
|
||||
LibraryDatabase.clean_standard_field = MT(lambda self, field, commit=False:None)
|
||||
@ -899,8 +900,3 @@ LibraryDatabase.commit = MT(lambda self:None)
|
||||
|
||||
del MT
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -396,7 +396,7 @@ class LegacyTest(BaseTest):
|
||||
|
||||
# Internal API
|
||||
'clean_user_categories', 'cleanup_tags', 'books_list_filter', 'conn', 'connect', 'construct_file_name',
|
||||
'construct_path_name', 'clear_dirtied', 'commit_dirty_cache', 'initialize_database', 'initialize_dynamic',
|
||||
'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',
|
||||
'windows_check_if_files_in_use', 'get_metadata_for_dump', 'get_a_dirtied_book', 'dirtied_sequence',
|
||||
|
@ -876,7 +876,8 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
||||
try:
|
||||
self.shutdown(write_settings=False)
|
||||
except:
|
||||
pass
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
e.accept()
|
||||
else:
|
||||
e.ignore()
|
||||
|
Loading…
x
Reference in New Issue
Block a user