mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
557e96cbdf
commit
04745b77b9
@ -146,6 +146,11 @@ class EditMetadataAction(InterfaceAction):
|
|||||||
checkbox_msg = _('Show the &failed books in the main book list '
|
checkbox_msg = _('Show the &failed books in the main book list '
|
||||||
'after updating metadata')
|
'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,
|
payload = (id_map, tdir, log_file, lm_map,
|
||||||
failed_ids.union(failed_covers))
|
failed_ids.union(failed_covers))
|
||||||
review_apply = partial(self.apply_downloaded_metadata, True)
|
review_apply = partial(self.apply_downloaded_metadata, True)
|
||||||
|
@ -131,6 +131,7 @@ def start_download(gui, ids, callback, ensure_fields=None):
|
|||||||
_('Download metadata for %d books')%len(ids),
|
_('Download metadata for %d books')%len(ids),
|
||||||
download, (ids, tf.name, gui.current_db, d.identify, d.covers,
|
download, (ids, tf.name, gui.current_db, d.identify, d.covers,
|
||||||
ensure_fields), {}, callback)
|
ensure_fields), {}, callback)
|
||||||
|
job.metadata_and_covers = (d.identify, d.covers)
|
||||||
job.download_debug_log = tf.name
|
job.download_debug_log = tf.name
|
||||||
gui.job_manager.run_threaded_job(job)
|
gui.job_manager.run_threaded_job(job)
|
||||||
gui.status_bar.show_message(_('Metadata download started'), 3000)
|
gui.status_bar.show_message(_('Metadata download started'), 3000)
|
||||||
@ -153,7 +154,7 @@ def get_job_details(job):
|
|||||||
all_failed, det_msg, lm_map)
|
all_failed, det_msg, lm_map)
|
||||||
|
|
||||||
class HeartBeat(object):
|
class HeartBeat(object):
|
||||||
CHECK_INTERVAL = 300 # seconds
|
CHECK_INTERVAL = 300 # seconds
|
||||||
''' Check that the file count in tdir changes every five minutes '''
|
''' Check that the file count in tdir changes every five minutes '''
|
||||||
|
|
||||||
def __init__(self, tdir):
|
def __init__(self, tdir):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user