mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make the set of books to refresh into a local variable buy using it as an object instance instead of by assignment.
This commit is contained in:
parent
cab3cba813
commit
8ede2d4666
@ -1751,9 +1751,7 @@ class DeviceMixin(object): # {{{
|
|||||||
self.db_book_title_cache = db_book_title_cache
|
self.db_book_title_cache = db_book_title_cache
|
||||||
self.db_book_uuid_cache = db_book_uuid_cache
|
self.db_book_uuid_cache = db_book_uuid_cache
|
||||||
|
|
||||||
# This is really a local variable, but it must be made into a class
|
book_ids_to_refresh = set()
|
||||||
# attribute so that the updateq function (below) can change it.
|
|
||||||
self.sbil_book_ids_to_refresh = set()
|
|
||||||
|
|
||||||
def update_book(id_, book) :
|
def update_book(id_, book) :
|
||||||
if not update_metadata:
|
if not update_metadata:
|
||||||
@ -1771,7 +1769,7 @@ class DeviceMixin(object): # {{{
|
|||||||
if self.device_manager.device is not None:
|
if self.device_manager.device is not None:
|
||||||
set_of_ids = self.device_manager.device.synchronize_with_db(db, id_, book)
|
set_of_ids = self.device_manager.device.synchronize_with_db(db, id_, book)
|
||||||
if set_of_ids is not None:
|
if set_of_ids is not None:
|
||||||
self.sbil_book_ids_to_refresh |= set_of_ids
|
book_ids_to_refresh.update(set_of_ids)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return (db.metadata_last_modified(id_, index_is_id=True) !=
|
return (db.metadata_last_modified(id_, index_is_id=True) !=
|
||||||
@ -1884,11 +1882,11 @@ class DeviceMixin(object): # {{{
|
|||||||
FunctionDispatcher(self.metadata_synced), booklists,
|
FunctionDispatcher(self.metadata_synced), booklists,
|
||||||
plugboards, add_as_step_to_job)
|
plugboards, add_as_step_to_job)
|
||||||
|
|
||||||
if self.sbil_book_ids_to_refresh:
|
if book_ids_to_refresh:
|
||||||
try:
|
try:
|
||||||
prints('DeviceJob: set_books_in_library refreshing GUI for ',
|
prints('DeviceJob: set_books_in_library refreshing GUI for ',
|
||||||
len(self.sbil_book_ids_to_refresh), 'books')
|
len(book_ids_to_refresh), 'books')
|
||||||
self.library_view.model().refresh_ids(self.sbil_book_ids_to_refresh,
|
self.library_view.model().refresh_ids(book_ids_to_refresh,
|
||||||
current_row=self.library_view.currentIndex().row())
|
current_row=self.library_view.currentIndex().row())
|
||||||
except:
|
except:
|
||||||
# This shouldn't ever happen, but just in case ...
|
# This shouldn't ever happen, but just in case ...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user