From 01a3782676ed75215463cd355d37f2023f9dcb9b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 6 Jul 2009 19:39:00 -0600 Subject: [PATCH] MOBI Output: Have the href of the periodical class TOC node point to the top of the first spine element --- src/calibre/ebooks/mobi/output.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/output.py b/src/calibre/ebooks/mobi/output.py index c8fe87a161..048185b170 100644 --- a/src/calibre/ebooks/mobi/output.py +++ b/src/calibre/ebooks/mobi/output.py @@ -76,6 +76,7 @@ class MOBIOutput(OutputFormatPlugin): from calibre.ebooks.oeb.base import TOC toc = self.oeb.toc if toc and toc[0].klass != 'periodical': + start_href = self.oeb.spine[0].href self.log('Converting TOC for MOBI periodical indexing...') articles = {} if toc.depth < 3: @@ -92,7 +93,7 @@ class MOBIOutput(OutputFormatPlugin): a.klass = 'article' articles[id(sec)].append(a) sec.nodes.remove(a) - root = TOC(klass='periodical', + root = TOC(klass='periodical', href=start_href, title=unicode(self.oeb.metadata.title[0])) for s in sections: if articles[id(s)]: