mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
EPUB metadata: When extracting covers from epub files handle invalid epubs that specify their content as a raster cover. Apparently PG produces these.
This commit is contained in:
parent
bfbd42dd6d
commit
1400f54107
@ -966,7 +966,9 @@ class OPF(object): # {{{
|
|||||||
cover_id = covers[0].get('content')
|
cover_id = covers[0].get('content')
|
||||||
for item in self.itermanifest():
|
for item in self.itermanifest():
|
||||||
if item.get('id', None) == cover_id:
|
if item.get('id', None) == cover_id:
|
||||||
return item.get('href', None)
|
mt = item.get('media-type', '')
|
||||||
|
if 'xml' not in mt:
|
||||||
|
return item.get('href', None)
|
||||||
|
|
||||||
@dynamic_property
|
@dynamic_property
|
||||||
def cover(self):
|
def cover(self):
|
||||||
|
@ -246,7 +246,7 @@ class ChooseLibraryAction(InterfaceAction):
|
|||||||
def delete_requested(self, name, location):
|
def delete_requested(self, name, location):
|
||||||
loc = location.replace('/', os.sep)
|
loc = location.replace('/', os.sep)
|
||||||
if not question_dialog(self.gui, _('Are you sure?'), '<p>'+
|
if not question_dialog(self.gui, _('Are you sure?'), '<p>'+
|
||||||
_('All files from %s will be '
|
_('<b>All files</b> from %s will be '
|
||||||
'<b>permanently deleted</b>. Are you sure?') % loc,
|
'<b>permanently deleted</b>. Are you sure?') % loc,
|
||||||
show_copy_button=False):
|
show_copy_button=False):
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user