Bulk metadata download fix reviewing only covers

Bulk metadata download: When downloading only covers and some covers
fail, do not show the failed books while reviewing downloaded metadata.
Fixes #1238271 [Download only Covers:  Reviewing -> The books with "no cover found" are also displayed.](https://bugs.launchpad.net/calibre/+bug/1238271)
This commit is contained in:
Kovid Goyal 2013-10-31 11:16:24 +05:30
parent 557e96cbdf
commit 04745b77b9
2 changed files with 7 additions and 1 deletions

View File

@ -146,6 +146,11 @@ class EditMetadataAction(InterfaceAction):
checkbox_msg = _('Show the &failed books in the main book list '
'after updating metadata')
if getattr(job, 'metadata_and_covers', None) == (False, True):
# Only covers, remove failed cover downloads from id_map
for book_id in failed_covers:
if hasattr(id_map, 'discard'):
id_map.discard(book_id)
payload = (id_map, tdir, log_file, lm_map,
failed_ids.union(failed_covers))
review_apply = partial(self.apply_downloaded_metadata, True)

View File

@ -131,6 +131,7 @@ def start_download(gui, ids, callback, ensure_fields=None):
_('Download metadata for %d books')%len(ids),
download, (ids, tf.name, gui.current_db, d.identify, d.covers,
ensure_fields), {}, callback)
job.metadata_and_covers = (d.identify, d.covers)
job.download_debug_log = tf.name
gui.job_manager.run_threaded_job(job)
gui.status_bar.show_message(_('Metadata download started'), 3000)