From 04745b77b97d8202da984cbcf4d0db0d9cf03f60 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 31 Oct 2013 11:16:24 +0530 Subject: [PATCH] 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) --- src/calibre/gui2/actions/edit_metadata.py | 5 +++++ src/calibre/gui2/metadata/bulk_download.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/actions/edit_metadata.py b/src/calibre/gui2/actions/edit_metadata.py index 367e4bbc37..16dff2f44a 100644 --- a/src/calibre/gui2/actions/edit_metadata.py +++ b/src/calibre/gui2/actions/edit_metadata.py @@ -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) diff --git a/src/calibre/gui2/metadata/bulk_download.py b/src/calibre/gui2/metadata/bulk_download.py index 9c56b5b0f8..e3b0203e82 100644 --- a/src/calibre/gui2/metadata/bulk_download.py +++ b/src/calibre/gui2/metadata/bulk_download.py @@ -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) @@ -153,7 +154,7 @@ def get_job_details(job): all_failed, det_msg, lm_map) class HeartBeat(object): - CHECK_INTERVAL = 300 # seconds + CHECK_INTERVAL = 300 # seconds ''' Check that the file count in tdir changes every five minutes ''' def __init__(self, tdir):