diff --git a/src/calibre/ebooks/mobi/writer.py b/src/calibre/ebooks/mobi/writer.py index f92e1bf2f9..c5bcee7e45 100644 --- a/src/calibre/ebooks/mobi/writer.py +++ b/src/calibre/ebooks/mobi/writer.py @@ -610,12 +610,21 @@ class MobiWriter(object): if (i>firstSequentialNode) and self._ctoc_map[i-1]['klass'] != 'section': if offset != previousOffset + previousLength : self._oeb.log.warning("*** TOC discontinuity: nodes are not sequential ***") - self._oeb.log.warning(" node %03d: '%s' offset: 0x%X length: 0x%X" % \ + self._oeb.log.info(" node %03d: '%s' offset: 0x%X length: 0x%X" % \ (i-1, entries[i-1].title, previousOffset, previousLength) ) self._oeb.log.warning(" node %03d: '%s' offset: 0x%X != 0x%06X" % \ (i, child.title, offset, previousOffset + previousLength) ) - self._oeb.log.warning("\tnode data %03d: %s" % (i-1, self._ctoc_map[i-1]) ) - self._oeb.log.warning("\tnode data %03d: %s" % (i, self._ctoc_map[i]) ) + # self._oeb.log.warning("\tnode data %03d: %s" % (i-1, self._ctoc_map[i-1]) ) + # self._oeb.log.warning("\tnode data %03d: %s" % (i, self._ctoc_map[i]) ) + # Dump the offending entry + self._oeb.log.info("...") + for z in range(i-6 if i-6 > 0 else 0, i+6 if i+6 < len(entries) else len(entries)): + if z == i: + self._oeb.log.warning("child %03d: %s" % (z, entries[z])) + else: + self._oeb.log.info("child %03d: %s" % (z, entries[z])) + self._oeb.log.info("...") + self._oeb.log.warning('_generate_indexed_navpoints: Failed to generate index') # Zero out self._HTMLRecords, return False self._HTMLRecords = [] diff --git a/src/calibre/library/catalog.py b/src/calibre/library/catalog.py index 9b82c7310e..85bd21692b 100644 --- a/src/calibre/library/catalog.py +++ b/src/calibre/library/catalog.py @@ -941,7 +941,7 @@ class EPUB_MOBI(CatalogPlugin): this_title['author'] = " & ".join(record['authors']) else: this_title['author'] = 'Unknown' - this_title['author_sort'] = record['author_sort'] if len(record['author_sort']) \ + this_title['author_sort'] = record['author_sort'].capitalize() if len(record['author_sort']) \ else self.author_to_author_sort(this_title['author']) this_title['id'] = record['id'] if record['publisher']: @@ -1089,6 +1089,7 @@ class EPUB_MOBI(CatalogPlugin): for author in unique_authors: self.opts.log.info((u" %-50s %-25s %2d" % (author[0][0:45], author[1][0:20], author[2])).encode('utf-8')) + self.authors = unique_authors def generateHTMLDescriptions(self): @@ -2490,7 +2491,7 @@ class EPUB_MOBI(CatalogPlugin): tokens = tokens[-1:] + tokens[:-1] if len(tokens) > 1: tokens[0] += ',' - return ' '.join(tokens) + return ' '.join(tokens).capitalize() def convertHTMLEntities(self, s): matches = re.findall("&#\d+;", s) @@ -3100,6 +3101,7 @@ class EPUB_MOBI(CatalogPlugin): op = self.opts.output_profile if op is None: op = 'default' + self.opts.output_profile = op opts.descriptionClip = 380 if op.endswith('dx') or 'kindle' not in op else 90 opts.basename = "Catalog" opts.plugin_path = self.plugin_path