mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
commit
40136065f4
@ -21,6 +21,7 @@ from calibre.utils.localization import get_lang
|
||||
|
||||
Option = namedtuple('Option', 'option, default, dest, action, help')
|
||||
|
||||
|
||||
class EPUB_MOBI(CatalogPlugin):
|
||||
'ePub catalog generator'
|
||||
|
||||
@ -386,6 +387,8 @@ class EPUB_MOBI(CatalogPlugin):
|
||||
if opts.fmt == 'mobi':
|
||||
recommendations.append(('no_inline_toc', True,
|
||||
OptionRecommendation.HIGH))
|
||||
recommendations.append(('verbose', 2,
|
||||
OptionRecommendation.HIGH))
|
||||
|
||||
# Use existing cover or generate new cover
|
||||
cpath = None
|
||||
@ -442,4 +445,3 @@ class EPUB_MOBI(CatalogPlugin):
|
||||
|
||||
# returns to gui2.actions.catalog:catalog_generated()
|
||||
return catalog.error
|
||||
|
||||
|
@ -126,7 +126,7 @@ class CatalogBuilder(object):
|
||||
self.bookmarked_books_by_date_read = None
|
||||
self.books_by_author = None
|
||||
self.books_by_date_range = None
|
||||
self.books_by_description = None
|
||||
self.books_by_description = []
|
||||
self.books_by_month = None
|
||||
self.books_by_series = None
|
||||
self.books_by_title = None
|
||||
@ -748,6 +748,7 @@ class CatalogBuilder(object):
|
||||
|
||||
# Assumes books_by_title already populated
|
||||
# init books_by_description before relisting multiple authors
|
||||
if self.opts.generate_descriptions:
|
||||
books_by_description = list(books_by_author) if self.opts.sort_descriptions_by_author \
|
||||
else list(self.books_by_title)
|
||||
|
||||
@ -760,6 +761,7 @@ class CatalogBuilder(object):
|
||||
asl = [i['author_sort'] for i in books_by_author]
|
||||
las = max(asl, key=len)
|
||||
|
||||
if self.opts.generate_descriptions:
|
||||
self.books_by_description = sorted(books_by_description,
|
||||
key=lambda x: sort_key(self._kf_books_by_author_sorter_author_sort(x, len(las))))
|
||||
|
||||
@ -2973,7 +2975,7 @@ class CatalogBuilder(object):
|
||||
contentTag = Tag(soup, 'content')
|
||||
contentTag['src'] = "content/ByDateAdded.html"
|
||||
navPointTag.insert(1, contentTag)
|
||||
else:
|
||||
elif self.opts.generate_descriptions:
|
||||
# Descriptions only
|
||||
contentTag = Tag(soup, 'content')
|
||||
contentTag['src'] = "content/book_%d.html" % int(self.books_by_description[0]['id'])
|
||||
@ -4103,7 +4105,6 @@ class CatalogBuilder(object):
|
||||
spine.insert(stc, itemrefTag)
|
||||
stc += 1
|
||||
|
||||
if self.opts.generate_descriptions:
|
||||
for book in self.books_by_description:
|
||||
# manifest
|
||||
itemTag = Tag(soup, "item")
|
||||
|
Loading…
x
Reference in New Issue
Block a user