mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
d5ae96dc4c
commit
09122265fd
@ -96,10 +96,11 @@ class EditMetadataAction(InterfaceAction):
|
||||
if aborted:
|
||||
return self.cleanup_bulk_download(tdir)
|
||||
if all_failed:
|
||||
num = len(failed_ids | failed_covers)
|
||||
self.cleanup_bulk_download(tdir)
|
||||
return error_dialog(self.gui, _('Download failed'),
|
||||
_('Failed to download metadata or covers for any of the %d'
|
||||
' book(s).') % len(id_map), det_msg=det_msg, show=True)
|
||||
' book(s).') % num, det_msg=det_msg, show=True)
|
||||
|
||||
self.gui.status_bar.show_message(_('Metadata download completed'), 3000)
|
||||
|
||||
@ -498,7 +499,7 @@ class EditMetadataAction(InterfaceAction):
|
||||
self.apply_id_map = list(id_map.iteritems())
|
||||
self.apply_current_idx = 0
|
||||
self.apply_failures = []
|
||||
self.applied_ids = []
|
||||
self.applied_ids = set()
|
||||
self.apply_pd = None
|
||||
self.apply_callback = callback
|
||||
if len(self.apply_id_map) > 1:
|
||||
@ -525,6 +526,7 @@ class EditMetadataAction(InterfaceAction):
|
||||
if cover:
|
||||
self.gui.current_db.set_cover(i, open(cover, 'rb'),
|
||||
notify=False, commit=False)
|
||||
self.applied_ids.add(i)
|
||||
else:
|
||||
self.apply_mi(i, mi)
|
||||
|
||||
@ -554,7 +556,7 @@ class EditMetadataAction(InterfaceAction):
|
||||
mi.tags = list(set(tags))
|
||||
db.set_metadata(book_id, mi, commit=False, set_title=set_title,
|
||||
set_authors=set_authors, notify=False)
|
||||
self.applied_ids.append(book_id)
|
||||
self.applied_ids.add(book_id)
|
||||
except:
|
||||
import traceback
|
||||
self.apply_failures.append((book_id, traceback.format_exc()))
|
||||
@ -589,7 +591,7 @@ class EditMetadataAction(InterfaceAction):
|
||||
if self.applied_ids:
|
||||
cr = self.gui.library_view.currentIndex().row()
|
||||
self.gui.library_view.model().refresh_ids(
|
||||
self.applied_ids, cr)
|
||||
list(self.applied_ids), cr)
|
||||
if self.gui.cover_flow:
|
||||
self.gui.cover_flow.dataChanged()
|
||||
self.gui.tags_view.recount()
|
||||
@ -598,7 +600,7 @@ class EditMetadataAction(InterfaceAction):
|
||||
self.apply_pd = None
|
||||
try:
|
||||
if callable(self.apply_callback):
|
||||
self.apply_callback(self.applied_ids)
|
||||
self.apply_callback(list(self.applied_ids))
|
||||
finally:
|
||||
self.apply_callback = None
|
||||
|
||||
|
@ -169,10 +169,6 @@ class HeartBeat(object):
|
||||
self.last_time = time.time()
|
||||
return True
|
||||
|
||||
# Fix log viewer, ratings
|
||||
# Test: abort, covers only, metadata only, both, 200 entry download, memory
|
||||
# consumption, all errors and on and on
|
||||
|
||||
def download(all_ids, tf, db, do_identify, covers, ensure_fields,
|
||||
log=None, abort=None, notifications=None):
|
||||
batch_size = 10
|
||||
|
Loading…
x
Reference in New Issue
Block a user