Fix #7071 (Download of metadata for multiple books has strange behaivour)

This commit is contained in:
Kovid Goyal 2010-10-07 14:29:32 -06:00
parent bd7e82b124
commit fe6816282f
3 changed files with 8 additions and 4 deletions

View File

@ -19,7 +19,6 @@ from calibre.ebooks.metadata.epub import set_metadata
from calibre.library.server.utils import strftime
from calibre.utils.config import config_dir, prefs
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.zipfile import ZipFile

View File

@ -144,10 +144,10 @@ class DownloadMetadata(Thread):
def commit_covers(self, all=False):
if all:
self.worker.jobs.put(False)
self.worker.jobs.put((False, False))
while True:
try:
id, fmi, ok, cdata = self.worker.results.get(False)
id, fmi, ok, cdata = self.worker.results.get_nowait()
if ok:
self.fetched_covers[id] = cdata
self.results.put((id, 'cover', ok, fmi.title))
@ -210,6 +210,12 @@ class DoDownload(QObject):
pass
if not self.downloader.is_alive():
self.timer.stop()
while True:
try:
r = self.downloader.results.get_nowait()
self.handle_result(r)
except Empty:
break
self.pd.accept()
def handle_result(self, r):

View File

@ -1010,7 +1010,6 @@ def command_restore_database(args, dbpath):
'saved to', name)
def list_categories_option_parser():
from calibre.library.check_library import CHECKS
parser = get_parser(_('''\
%prog list_categories [options]