mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Fix incorrect syncing behavior when book matching is run for a second time while connected. This happens when the user changes the library or selects "Update cached metadata on device".
This commit is contained in:
parent
9c9759684e
commit
74c60c718b
@ -1344,6 +1344,25 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin):
|
||||
print_debug_info=False,
|
||||
wait_for_response=False)
|
||||
|
||||
if not self.have_bad_sync_columns:
|
||||
# Update the local copy of the device's read info just in case
|
||||
# the device is re-synced. This emulates what happens on the device
|
||||
# when the metadata is received.
|
||||
try:
|
||||
if bool(self.is_read_sync_col):
|
||||
book.set('_is_read_', book.get(self.is_read_sync_col, None))
|
||||
except:
|
||||
self._debug('failed to set local copy of _is_read_')
|
||||
traceback.print_exc()
|
||||
|
||||
try:
|
||||
if bool(self.is_read_date_sync_col):
|
||||
book.set('_last_read_date_',
|
||||
book.get(self.is_read_date_sync_col, None))
|
||||
except:
|
||||
self._debug('failed to set local copy of _last_read_date_')
|
||||
traceback.print_exc()
|
||||
|
||||
@synchronous('sync_lock')
|
||||
def eject(self):
|
||||
self._debug()
|
||||
|
Loading…
x
Reference in New Issue
Block a user