mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Make ignore_errors also work for setting covers
This commit is contained in:
parent
2fd8022e9e
commit
47b927f5bc
@ -1085,14 +1085,18 @@ class Cache(object):
|
||||
raise
|
||||
|
||||
# force_changes has no effect on cover manipulation
|
||||
try:
|
||||
cdata = mi.cover_data[1]
|
||||
if cdata is None and isinstance(mi.cover, basestring) and mi.cover and os.access(mi.cover, os.R_OK):
|
||||
with lopen(mi.cover, 'rb') as f:
|
||||
raw = f.read()
|
||||
if raw:
|
||||
cdata = raw
|
||||
cdata = f.read() or None
|
||||
if cdata is not None:
|
||||
self._set_cover({book_id: cdata})
|
||||
except:
|
||||
if ignore_errors:
|
||||
traceback.print_exc()
|
||||
else:
|
||||
raise
|
||||
|
||||
try:
|
||||
with self.backend.conn: # Speed up set_metadata by not operating in autocommit mode
|
||||
|
Loading…
x
Reference in New Issue
Block a user