E-book viewer: Fix a regression in the previous release that caused annotations/last read information to not be saved in e-book files. Fixes #2146912 [Last location not saved](https://bugs.launchpad.net/calibre/+bug/2146912)

Merge branch 'copilot/fix-epub-annotations-regression' of https://github.com/kovidgoyal/calibre
This commit is contained in:
Kovid Goyal 2026-04-08 19:17:20 +05:30
commit 04e409f4e9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -67,19 +67,20 @@ class AnnotationsSaveWorker(Thread):
self.queue = Queue()
def shutdown(self):
self.queue.shutdown(True)
self.queue.shutdown(immediate=False)
self.join()
def run(self):
while True:
try:
x = self.queue.get()
while True:
try:
x = self.queue.get_nowait()
except Empty:
break
except ShutDown:
break
while True:
try:
x = self.queue.get_nowait()
except (Empty, ShutDown):
break
annotations_list = x['annotations_list']
annotations_path_key = x['annotations_path_key']
bld = x['book_library_details']