From 49a57787beba9dee6c0e2e44c3c20d5fcf1f6963 Mon Sep 17 00:00:00 2001 From: GRiker Date: Tue, 16 Feb 2010 02:59:43 -0700 Subject: [PATCH] GwR EPUB TOC label change --- src/calibre/library/catalog.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/calibre/library/catalog.py b/src/calibre/library/catalog.py index b7ece0bc78..857b56216a 100644 --- a/src/calibre/library/catalog.py +++ b/src/calibre/library/catalog.py @@ -1,4 +1,4 @@ -import datetime, htmlentitydefs, os, re, shutil, time, traceback +import datetime, htmlentitydefs, os, re, shutil, time from collections import namedtuple from copy import deepcopy @@ -2205,9 +2205,23 @@ class EPUB_MOBI(CatalogPlugin): textTag = Tag(ncx_soup, "text") if book['series']: tokens = book['title'].split(': ') - textTag.insert(0, NavigableString(self.formatNCXText('%s (%s)' % (tokens[1], tokens[0]), dest='title'))) + if self.generateForKindle: + # Don't include Author for Kindle + textTag.insert(0, NavigableString(self.formatNCXText('%s (%s)' % \ + (tokens[1], tokens[0]), dest='title'))) + else: + # Include Author for non-Kindle + textTag.insert(0, NavigableString(self.formatNCXText('%s · %s (%s)' % \ + (tokens[1], book['author'], tokens[0]), dest='title'))) else: - textTag.insert(0, NavigableString(self.formatNCXText(book['title'], dest='title'))) + if self.generateForKindle: + # Don't include Author for Kindle + textTag.insert(0, NavigableString(self.formatNCXText('%s' % (book['title']), + dest='title'))) + else: + # Include Author for non-Kindle + textTag.insert(0, NavigableString(self.formatNCXText('%s · %s' % \ + (book['title'], book['author']), dest='title'))) navLabelTag.insert(0,textTag) navPointVolumeTag.insert(0,navLabelTag)