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:
Kovid Goyal 2011-05-04 11:02:56 -06:00
parent bfbd42dd6d
commit 1400f54107
2 changed files with 4 additions and 2 deletions

View File

@ -966,7 +966,9 @@ class OPF(object): # {{{
cover_id = covers[0].get('content')
for item in self.itermanifest():
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
def cover(self):

View File

@ -246,7 +246,7 @@ class ChooseLibraryAction(InterfaceAction):
def delete_requested(self, name, location):
loc = location.replace('/', os.sep)
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,
show_copy_button=False):
return