mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #7071 (Download of metadata for multiple books has strange behaivour)
This commit is contained in:
parent
bd7e82b124
commit
fe6816282f
@ -19,7 +19,6 @@ from calibre.ebooks.metadata.epub import set_metadata
|
|||||||
from calibre.library.server.utils import strftime
|
from calibre.library.server.utils import strftime
|
||||||
from calibre.utils.config import config_dir, prefs
|
from calibre.utils.config import config_dir, prefs
|
||||||
from calibre.utils.date import isoformat, now, parse_date
|
from calibre.utils.date import isoformat, now, parse_date
|
||||||
from calibre.utils.localization import get_lang
|
|
||||||
from calibre.utils.logging import Log
|
from calibre.utils.logging import Log
|
||||||
from calibre.utils.zipfile import ZipFile
|
from calibre.utils.zipfile import ZipFile
|
||||||
|
|
||||||
|
@ -144,10 +144,10 @@ class DownloadMetadata(Thread):
|
|||||||
|
|
||||||
def commit_covers(self, all=False):
|
def commit_covers(self, all=False):
|
||||||
if all:
|
if all:
|
||||||
self.worker.jobs.put(False)
|
self.worker.jobs.put((False, False))
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
id, fmi, ok, cdata = self.worker.results.get(False)
|
id, fmi, ok, cdata = self.worker.results.get_nowait()
|
||||||
if ok:
|
if ok:
|
||||||
self.fetched_covers[id] = cdata
|
self.fetched_covers[id] = cdata
|
||||||
self.results.put((id, 'cover', ok, fmi.title))
|
self.results.put((id, 'cover', ok, fmi.title))
|
||||||
@ -210,6 +210,12 @@ class DoDownload(QObject):
|
|||||||
pass
|
pass
|
||||||
if not self.downloader.is_alive():
|
if not self.downloader.is_alive():
|
||||||
self.timer.stop()
|
self.timer.stop()
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
r = self.downloader.results.get_nowait()
|
||||||
|
self.handle_result(r)
|
||||||
|
except Empty:
|
||||||
|
break
|
||||||
self.pd.accept()
|
self.pd.accept()
|
||||||
|
|
||||||
def handle_result(self, r):
|
def handle_result(self, r):
|
||||||
|
@ -1010,7 +1010,6 @@ def command_restore_database(args, dbpath):
|
|||||||
'saved to', name)
|
'saved to', name)
|
||||||
|
|
||||||
def list_categories_option_parser():
|
def list_categories_option_parser():
|
||||||
from calibre.library.check_library import CHECKS
|
|
||||||
parser = get_parser(_('''\
|
parser = get_parser(_('''\
|
||||||
%prog list_categories [options]
|
%prog list_categories [options]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user