This commit is contained in:
Kovid Goyal 2012-05-03 18:49:00 +05:30
parent 27d199a74b
commit c66ec1c9f2
2 changed files with 2 additions and 3 deletions

View File

@ -211,8 +211,7 @@ class EPUBInput(InputFormatPlugin):
cover_toc_item = item cover_toc_item = item
break break
spine = {x.href for x in oeb.spine} spine = {x.href for x in oeb.spine}
if (cover_toc_item is not None and cover_toc_item.count() == 0 and if (cover_toc_item is not None and cover_toc_item not in spine):
cover_toc_item not in spine):
oeb.toc.item_that_refers_to_cover = cover_toc_item oeb.toc.item_that_refers_to_cover = cover_toc_item

View File

@ -1015,7 +1015,7 @@ OptionRecommendation(name='search_replace',
# Remove the toc reference to the html cover, if any, except for # Remove the toc reference to the html cover, if any, except for
# epub, as the epub output plugin will do the right thing with it. # epub, as the epub output plugin will do the right thing with it.
item = getattr(self.oeb.toc, 'item_that_refers_to_cover', None) item = getattr(self.oeb.toc, 'item_that_refers_to_cover', None)
if item is not None: if item is not None and item.count() == 0:
self.oeb.toc.remove(item) self.oeb.toc.remove(item)
from calibre.ebooks.oeb.transforms.flatcss import CSSFlattener from calibre.ebooks.oeb.transforms.flatcss import CSSFlattener