Disabled code to change single section periodical indexing on SONYs.

This commit is contained in:
Kovid Goyal 2011-08-31 16:47:20 -06:00
parent af246ff350
commit dff342fc32

View File

@ -116,9 +116,22 @@ def sony_metadata(oeb):
except:
base_id = str(uuid4())
toc = oeb.toc
if False and toc.depth() < 3:
# Single section periodical
# Disabled since I prefer the current behavior
from calibre.ebooks.oeb.base import TOC
section = TOC(klass='section', title=_('All articles'),
href=oeb.spine[2].href)
for x in toc: section.nodes.append(x)
toc = TOC(klass='periodical', href=oeb.spine[2].href,
title=unicode(oeb.metadata.title[0]))
toc.nodes.append(section)
entries = []
seen_titles = set([])
for i, section in enumerate(oeb.toc):
for i, section in enumerate(toc):
if not section.href:
continue
secid = 'section%d'%i