mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Apple driver: Ignore invalid EPUBs when sending to iTunes
This commit is contained in:
parent
41c25e037b
commit
64fd29fa3e
@ -2512,7 +2512,12 @@ class ITUNES(DriverBase):
|
|||||||
# Refresh epub metadata
|
# Refresh epub metadata
|
||||||
with open(fpath,'r+b') as zfo:
|
with open(fpath,'r+b') as zfo:
|
||||||
# Touch the OPF timestamp
|
# Touch the OPF timestamp
|
||||||
zf_opf = ZipFile(fpath,'r')
|
try:
|
||||||
|
zf_opf = ZipFile(fpath,'r')
|
||||||
|
except:
|
||||||
|
raise UserFeedback("'%s' is not a valid EPUB" % metadata.title,
|
||||||
|
None,
|
||||||
|
level=UserFeedback.WARN)
|
||||||
fnames = zf_opf.namelist()
|
fnames = zf_opf.namelist()
|
||||||
opf = [x for x in fnames if '.opf' in x][0]
|
opf = [x for x in fnames if '.opf' in x][0]
|
||||||
if opf:
|
if opf:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user