mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
When bulk downloading metadata and the user deletes one of the books for which metadata is being downloaded, just ignore it, instead of erroring out
This commit is contained in:
parent
4017e381a0
commit
b4d6e46057
@ -132,7 +132,7 @@ class EditMetadataAction(InterfaceAction):
|
||||
|
||||
for i in good_ids:
|
||||
lm = db.metadata_last_modified(i, index_is_id=True)
|
||||
if lm > lm_map[i]:
|
||||
if lm is not None and lm_map[i] is not None and lm > lm_map[i]:
|
||||
title = db.title(i, index_is_id=True)
|
||||
authors = db.authors(i, index_is_id=True)
|
||||
if authors:
|
||||
@ -516,6 +516,7 @@ class EditMetadataAction(InterfaceAction):
|
||||
return self.finalize_apply()
|
||||
|
||||
i, mi = self.apply_id_map[self.apply_current_idx]
|
||||
if self.gui.current_db.has_id(i):
|
||||
if isinstance(mi, tuple):
|
||||
opf, cover = mi
|
||||
if opf:
|
||||
|
@ -1023,6 +1023,9 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
||||
return bool(self.conn.get('SELECT id FROM books where title=?', (title,), all=False))
|
||||
return False
|
||||
|
||||
def has_id(self, id_):
|
||||
return self.data._data[id_] is not None
|
||||
|
||||
def books_with_same_title(self, mi, all_matches=True):
|
||||
title = mi.title
|
||||
ans = set()
|
||||
|
Loading…
x
Reference in New Issue
Block a user