mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Catalogs: Fix AZW3 output not properly indexed
This commit is contained in:
commit
ac59059083
@ -360,13 +360,14 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
recommendations.append(('debug_pipeline', dp,
|
recommendations.append(('debug_pipeline', dp,
|
||||||
OptionRecommendation.HIGH))
|
OptionRecommendation.HIGH))
|
||||||
|
|
||||||
if opts.fmt == 'mobi' and opts.output_profile and opts.output_profile.startswith("kindle"):
|
if opts.output_profile and opts.output_profile.startswith("kindle"):
|
||||||
recommendations.append(('output_profile', opts.output_profile,
|
recommendations.append(('output_profile', opts.output_profile,
|
||||||
OptionRecommendation.HIGH))
|
OptionRecommendation.HIGH))
|
||||||
recommendations.append(('no_inline_toc', True,
|
|
||||||
OptionRecommendation.HIGH))
|
|
||||||
recommendations.append(('book_producer',opts.output_profile,
|
recommendations.append(('book_producer',opts.output_profile,
|
||||||
OptionRecommendation.HIGH))
|
OptionRecommendation.HIGH))
|
||||||
|
if opts.fmt == 'mobi':
|
||||||
|
recommendations.append(('no_inline_toc', True,
|
||||||
|
OptionRecommendation.HIGH))
|
||||||
|
|
||||||
# Use existing cover or generate new cover
|
# Use existing cover or generate new cover
|
||||||
cpath = None
|
cpath = None
|
||||||
|
@ -33,6 +33,12 @@ class CatalogBuilder(object):
|
|||||||
catalog = Catalog(notification=Reporter())
|
catalog = Catalog(notification=Reporter())
|
||||||
catalog.build_sources()
|
catalog.build_sources()
|
||||||
Options managed in gui2.catalog.catalog_epub_mobi.py
|
Options managed in gui2.catalog.catalog_epub_mobi.py
|
||||||
|
|
||||||
|
Turned off fetch_bookmarks as of 0.8.70
|
||||||
|
self.generate_recently_read = True if (_opts.generate_recently_added and
|
||||||
|
_opts.connected_kindle and
|
||||||
|
self.generate_for_kindle_mobi) else False
|
||||||
|
Does not work with AZW3, interferes with new prefix handling
|
||||||
'''
|
'''
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
@ -85,9 +91,9 @@ class CatalogBuilder(object):
|
|||||||
@property
|
@property
|
||||||
def SYMBOL_READING(self):
|
def SYMBOL_READING(self):
|
||||||
if self.generate_for_kindle_mobi:
|
if self.generate_for_kindle_mobi:
|
||||||
return self.format_prefix('▷')
|
return '▷'
|
||||||
else:
|
else:
|
||||||
return self.format_prefix(' ')
|
return ' '
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, db, _opts, plugin,
|
def __init__(self, db, _opts, plugin,
|
||||||
@ -123,9 +129,7 @@ class CatalogBuilder(object):
|
|||||||
self.content_dir = os.path.join(self.catalog_path, "content")
|
self.content_dir = os.path.join(self.catalog_path, "content")
|
||||||
self.current_step = 0.0
|
self.current_step = 0.0
|
||||||
self.error = []
|
self.error = []
|
||||||
self.generate_recently_read = True if (_opts.generate_recently_added and
|
self.generate_recently_read = False
|
||||||
_opts.connected_kindle and
|
|
||||||
self.generate_for_kindle_mobi) else False
|
|
||||||
self.genres = []
|
self.genres = []
|
||||||
self.genre_tags_dict = None
|
self.genre_tags_dict = None
|
||||||
self.html_filelist_1 = []
|
self.html_filelist_1 = []
|
||||||
@ -460,8 +464,9 @@ class CatalogBuilder(object):
|
|||||||
catalog_resources = P("catalog")
|
catalog_resources = P("catalog")
|
||||||
|
|
||||||
files_to_copy = [('','DefaultCover.jpg'),
|
files_to_copy = [('','DefaultCover.jpg'),
|
||||||
('content','stylesheet.css'),
|
('content','stylesheet.css')]
|
||||||
('images','mastheadImage.gif')]
|
if self.generate_for_kindle_mobi:
|
||||||
|
files_to_copy.extend([('images','mastheadImage.gif')])
|
||||||
|
|
||||||
for file in files_to_copy:
|
for file in files_to_copy:
|
||||||
if file[0] == '':
|
if file[0] == '':
|
||||||
@ -958,7 +963,7 @@ class CatalogBuilder(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from calibre.devices.usbms.device import Device
|
from calibre.devices.usbms.device import Device
|
||||||
from calibre.devices.kindle.driver import Bookmark
|
from calibre.devices.kindle.bookmark import Bookmark
|
||||||
from calibre.ebooks.metadata import MetaInformation
|
from calibre.ebooks.metadata import MetaInformation
|
||||||
|
|
||||||
MBP_FORMATS = [u'azw', u'mobi', u'prc', u'txt']
|
MBP_FORMATS = [u'azw', u'mobi', u'prc', u'txt']
|
||||||
@ -984,7 +989,10 @@ class CatalogBuilder(object):
|
|||||||
file_fmts.add(fmt)
|
file_fmts.add(fmt)
|
||||||
|
|
||||||
bookmark_extension = None
|
bookmark_extension = None
|
||||||
if file_fmts.intersection(mbp_formats):
|
if file_fmts.intersection(han_formats):
|
||||||
|
book_extension = list(file_fmts.intersection(han_formats))[0]
|
||||||
|
bookmark_extension = 'han'
|
||||||
|
elif file_fmts.intersection(mbp_formats):
|
||||||
book_extension = list(file_fmts.intersection(mbp_formats))[0]
|
book_extension = list(file_fmts.intersection(mbp_formats))[0]
|
||||||
bookmark_extension = 'mbp'
|
bookmark_extension = 'mbp'
|
||||||
elif file_fmts.intersection(tan_formats):
|
elif file_fmts.intersection(tan_formats):
|
||||||
@ -1011,6 +1019,7 @@ class CatalogBuilder(object):
|
|||||||
path_map.pop(id)
|
path_map.pop(id)
|
||||||
return path_map, book_ext
|
return path_map, book_ext
|
||||||
|
|
||||||
|
self.bookmarked_books = {}
|
||||||
if self.generate_recently_read:
|
if self.generate_recently_read:
|
||||||
self.opts.log.info(" Collecting Kindle bookmarks matching catalog entries")
|
self.opts.log.info(" Collecting Kindle bookmarks matching catalog entries")
|
||||||
|
|
||||||
@ -1045,8 +1054,6 @@ class CatalogBuilder(object):
|
|||||||
bookmarks[id] = ((myBookmark,book))
|
bookmarks[id] = ((myBookmark,book))
|
||||||
|
|
||||||
self.bookmarked_books = bookmarks
|
self.bookmarked_books = bookmarks
|
||||||
else:
|
|
||||||
self.bookmarked_books = {}
|
|
||||||
|
|
||||||
def filter_db_tags(self):
|
def filter_db_tags(self):
|
||||||
""" Remove excluded tags from data set, return normalized genre list.
|
""" Remove excluded tags from data set, return normalized genre list.
|
||||||
@ -2781,7 +2788,8 @@ class CatalogBuilder(object):
|
|||||||
ncx = soup.find('ncx')
|
ncx = soup.find('ncx')
|
||||||
navMapTag = Tag(soup, 'navMap')
|
navMapTag = Tag(soup, 'navMap')
|
||||||
navPointTag = Tag(soup, 'navPoint')
|
navPointTag = Tag(soup, 'navPoint')
|
||||||
navPointTag['class'] = "periodical"
|
if self.generate_for_kindle_mobi:
|
||||||
|
navPointTag['class'] = "periodical"
|
||||||
navPointTag['id'] = "title"
|
navPointTag['id'] = "title"
|
||||||
navPointTag['playOrder'] = self.play_order
|
navPointTag['playOrder'] = self.play_order
|
||||||
self.play_order += 1
|
self.play_order += 1
|
||||||
@ -2820,12 +2828,13 @@ class CatalogBuilder(object):
|
|||||||
contentTag['src'] = "content/book_%d.html" % int(sort_descriptions_by[0]['id'])
|
contentTag['src'] = "content/book_%d.html" % int(sort_descriptions_by[0]['id'])
|
||||||
navPointTag.insert(1, contentTag)
|
navPointTag.insert(1, contentTag)
|
||||||
|
|
||||||
cmiTag = Tag(soup, '%s' % 'calibre:meta-img')
|
if self.generate_for_kindle_mobi:
|
||||||
cmiTag['id'] = "mastheadImage"
|
cmiTag = Tag(soup, '%s' % 'calibre:meta-img')
|
||||||
cmiTag['src'] = "images/mastheadImage.gif"
|
cmiTag['id'] = "mastheadImage"
|
||||||
navPointTag.insert(2,cmiTag)
|
cmiTag['src'] = "images/mastheadImage.gif"
|
||||||
navMapTag.insert(0,navPointTag)
|
navPointTag.insert(2,cmiTag)
|
||||||
|
|
||||||
|
navMapTag.insert(0,navPointTag)
|
||||||
ncx.insert(0,navMapTag)
|
ncx.insert(0,navMapTag)
|
||||||
self.ncx_soup = soup
|
self.ncx_soup = soup
|
||||||
|
|
||||||
@ -2846,15 +2855,19 @@ class CatalogBuilder(object):
|
|||||||
|
|
||||||
self.update_progress_full_step(_("NCX for Descriptions"))
|
self.update_progress_full_step(_("NCX for Descriptions"))
|
||||||
|
|
||||||
# --- Construct the 'Books by Title' section ---
|
sort_descriptions_by = self.books_by_author if self.opts.sort_descriptions_by_author \
|
||||||
|
else self.books_by_title
|
||||||
|
|
||||||
|
# --- Construct the 'Descriptions' section ---
|
||||||
ncx_soup = self.ncx_soup
|
ncx_soup = self.ncx_soup
|
||||||
body = ncx_soup.find("navPoint")
|
body = ncx_soup.find("navPoint")
|
||||||
btc = len(body.contents)
|
btc = len(body.contents)
|
||||||
|
|
||||||
# Add the section navPoint
|
# Add the section navPoint
|
||||||
navPointTag = Tag(ncx_soup, 'navPoint')
|
navPointTag = Tag(ncx_soup, 'navPoint')
|
||||||
navPointTag['class'] = "section"
|
if self.generate_for_kindle_mobi:
|
||||||
navPointTag['id'] = "bytitle-ID"
|
navPointTag['class'] = "section"
|
||||||
|
navPointTag['id'] = "bydescription-ID"
|
||||||
navPointTag['playOrder'] = self.play_order
|
navPointTag['playOrder'] = self.play_order
|
||||||
self.play_order += 1
|
self.play_order += 1
|
||||||
navLabelTag = Tag(ncx_soup, 'navLabel')
|
navLabelTag = Tag(ncx_soup, 'navLabel')
|
||||||
@ -2865,17 +2878,16 @@ class CatalogBuilder(object):
|
|||||||
navPointTag.insert(nptc, navLabelTag)
|
navPointTag.insert(nptc, navLabelTag)
|
||||||
nptc += 1
|
nptc += 1
|
||||||
contentTag = Tag(ncx_soup,"content")
|
contentTag = Tag(ncx_soup,"content")
|
||||||
contentTag['src'] = "content/book_%d.html" % int(self.books_by_title[0]['id'])
|
contentTag['src'] = "content/book_%d.html" % int(sort_descriptions_by[0]['id'])
|
||||||
navPointTag.insert(nptc, contentTag)
|
navPointTag.insert(nptc, contentTag)
|
||||||
nptc += 1
|
nptc += 1
|
||||||
|
|
||||||
# Loop over the titles
|
# Loop over the titles
|
||||||
sort_descriptions_by = self.books_by_author if self.opts.sort_descriptions_by_author \
|
|
||||||
else self.books_by_title
|
|
||||||
|
|
||||||
for book in sort_descriptions_by:
|
for book in sort_descriptions_by:
|
||||||
navPointVolumeTag = Tag(ncx_soup, 'navPoint')
|
navPointVolumeTag = Tag(ncx_soup, 'navPoint')
|
||||||
navPointVolumeTag['class'] = "article"
|
if self.generate_for_kindle_mobi:
|
||||||
|
navPointVolumeTag['class'] = "article"
|
||||||
navPointVolumeTag['id'] = "book%dID" % int(book['id'])
|
navPointVolumeTag['id'] = "book%dID" % int(book['id'])
|
||||||
navPointVolumeTag['playOrder'] = self.play_order
|
navPointVolumeTag['playOrder'] = self.play_order
|
||||||
self.play_order += 1
|
self.play_order += 1
|
||||||
@ -2979,7 +2991,8 @@ class CatalogBuilder(object):
|
|||||||
|
|
||||||
# --- Construct the 'Books By Series' section ---
|
# --- Construct the 'Books By Series' section ---
|
||||||
navPointTag = Tag(soup, 'navPoint')
|
navPointTag = Tag(soup, 'navPoint')
|
||||||
navPointTag['class'] = "section"
|
if self.generate_for_kindle_mobi:
|
||||||
|
navPointTag['class'] = "section"
|
||||||
navPointTag['id'] = "byseries-ID"
|
navPointTag['id'] = "byseries-ID"
|
||||||
navPointTag['playOrder'] = self.play_order
|
navPointTag['playOrder'] = self.play_order
|
||||||
self.play_order += 1
|
self.play_order += 1
|
||||||
@ -3035,7 +3048,8 @@ class CatalogBuilder(object):
|
|||||||
# Add *article* entries for each populated series title letter
|
# Add *article* entries for each populated series title letter
|
||||||
for (i,books) in enumerate(series_by_letter):
|
for (i,books) in enumerate(series_by_letter):
|
||||||
navPointByLetterTag = Tag(soup, 'navPoint')
|
navPointByLetterTag = Tag(soup, 'navPoint')
|
||||||
navPointByLetterTag['class'] = "article"
|
if self.generate_for_kindle_mobi:
|
||||||
|
navPointByLetterTag['class'] = "article"
|
||||||
navPointByLetterTag['id'] = "%sSeries-ID" % (title_letters[i].upper())
|
navPointByLetterTag['id'] = "%sSeries-ID" % (title_letters[i].upper())
|
||||||
navPointTag['playOrder'] = self.play_order
|
navPointTag['playOrder'] = self.play_order
|
||||||
self.play_order += 1
|
self.play_order += 1
|
||||||
@ -3102,7 +3116,8 @@ class CatalogBuilder(object):
|
|||||||
|
|
||||||
# --- Construct the 'Books By Title' section ---
|
# --- Construct the 'Books By Title' section ---
|
||||||
navPointTag = Tag(soup, 'navPoint')
|
navPointTag = Tag(soup, 'navPoint')
|
||||||
navPointTag['class'] = "section"
|
if self.generate_for_kindle_mobi:
|
||||||
|
navPointTag['class'] = "section"
|
||||||
navPointTag['id'] = "byalphatitle-ID"
|
navPointTag['id'] = "byalphatitle-ID"
|
||||||
navPointTag['playOrder'] = self.play_order
|
navPointTag['playOrder'] = self.play_order
|
||||||
self.play_order += 1
|
self.play_order += 1
|
||||||
@ -3160,7 +3175,8 @@ class CatalogBuilder(object):
|
|||||||
# Add *article* entries for each populated title letter
|
# Add *article* entries for each populated title letter
|
||||||
for (i,books) in enumerate(books_by_letter):
|
for (i,books) in enumerate(books_by_letter):
|
||||||
navPointByLetterTag = Tag(soup, 'navPoint')
|
navPointByLetterTag = Tag(soup, 'navPoint')
|
||||||
navPointByLetterTag['class'] = "article"
|
if self.generate_for_kindle_mobi:
|
||||||
|
navPointByLetterTag['class'] = "article"
|
||||||
navPointByLetterTag['id'] = "%sTitles-ID" % (title_letters[i].upper())
|
navPointByLetterTag['id'] = "%sTitles-ID" % (title_letters[i].upper())
|
||||||
navPointTag['playOrder'] = self.play_order
|
navPointTag['playOrder'] = self.play_order
|
||||||
self.play_order += 1
|
self.play_order += 1
|
||||||
@ -3225,7 +3241,8 @@ class CatalogBuilder(object):
|
|||||||
|
|
||||||
# --- Construct the 'Books By Author' *section* ---
|
# --- Construct the 'Books By Author' *section* ---
|
||||||
navPointTag = Tag(soup, 'navPoint')
|
navPointTag = Tag(soup, 'navPoint')
|
||||||
navPointTag['class'] = "section"
|
if self.generate_for_kindle_mobi:
|
||||||
|
navPointTag['class'] = "section"
|
||||||
file_ID = "%s" % tocTitle.lower()
|
file_ID = "%s" % tocTitle.lower()
|
||||||
file_ID = file_ID.replace(" ","")
|
file_ID = file_ID.replace(" ","")
|
||||||
navPointTag['id'] = "%s-ID" % file_ID
|
navPointTag['id'] = "%s-ID" % file_ID
|
||||||
@ -3275,7 +3292,8 @@ class CatalogBuilder(object):
|
|||||||
# master_author_list{}: [0]:author list [1]:Initial letter
|
# master_author_list{}: [0]:author list [1]:Initial letter
|
||||||
for authors_by_letter in master_author_list:
|
for authors_by_letter in master_author_list:
|
||||||
navPointByLetterTag = Tag(soup, 'navPoint')
|
navPointByLetterTag = Tag(soup, 'navPoint')
|
||||||
navPointByLetterTag['class'] = "article"
|
if self.generate_for_kindle_mobi:
|
||||||
|
navPointByLetterTag['class'] = "article"
|
||||||
navPointByLetterTag['id'] = "%sauthors-ID" % (authors_by_letter[1])
|
navPointByLetterTag['id'] = "%sauthors-ID" % (authors_by_letter[1])
|
||||||
navPointTag['playOrder'] = self.play_order
|
navPointTag['playOrder'] = self.play_order
|
||||||
self.play_order += 1
|
self.play_order += 1
|
||||||
@ -3346,7 +3364,8 @@ class CatalogBuilder(object):
|
|||||||
|
|
||||||
# --- Construct the 'Recently Added' *section* ---
|
# --- Construct the 'Recently Added' *section* ---
|
||||||
navPointTag = Tag(soup, 'navPoint')
|
navPointTag = Tag(soup, 'navPoint')
|
||||||
navPointTag['class'] = "section"
|
if self.generate_for_kindle_mobi:
|
||||||
|
navPointTag['class'] = "section"
|
||||||
file_ID = "%s" % tocTitle.lower()
|
file_ID = "%s" % tocTitle.lower()
|
||||||
file_ID = file_ID.replace(" ","")
|
file_ID = file_ID.replace(" ","")
|
||||||
navPointTag['id'] = "%s-ID" % file_ID
|
navPointTag['id'] = "%s-ID" % file_ID
|
||||||
@ -3390,7 +3409,8 @@ class CatalogBuilder(object):
|
|||||||
# master_date_range_list{}: [0]:titles list [1]:datestr
|
# master_date_range_list{}: [0]:titles list [1]:datestr
|
||||||
for books_by_date_range in master_date_range_list:
|
for books_by_date_range in master_date_range_list:
|
||||||
navPointByDateRangeTag = Tag(soup, 'navPoint')
|
navPointByDateRangeTag = Tag(soup, 'navPoint')
|
||||||
navPointByDateRangeTag['class'] = "article"
|
if self.generate_for_kindle_mobi:
|
||||||
|
navPointByDateRangeTag['class'] = "article"
|
||||||
navPointByDateRangeTag['id'] = "%s-ID" % books_by_date_range[1].replace(' ','')
|
navPointByDateRangeTag['id'] = "%s-ID" % books_by_date_range[1].replace(' ','')
|
||||||
navPointTag['playOrder'] = self.play_order
|
navPointTag['playOrder'] = self.play_order
|
||||||
self.play_order += 1
|
self.play_order += 1
|
||||||
@ -3449,7 +3469,8 @@ class CatalogBuilder(object):
|
|||||||
for books_by_month in master_month_list:
|
for books_by_month in master_month_list:
|
||||||
datestr = strftime(u'%B %Y', books_by_month[1].timetuple())
|
datestr = strftime(u'%B %Y', books_by_month[1].timetuple())
|
||||||
navPointByMonthTag = Tag(soup, 'navPoint')
|
navPointByMonthTag = Tag(soup, 'navPoint')
|
||||||
navPointByMonthTag['class'] = "article"
|
if self.generate_for_kindle_mobi:
|
||||||
|
navPointByMonthTag['class'] = "article"
|
||||||
navPointByMonthTag['id'] = "bda_%s-%s-ID" % (books_by_month[1].year,books_by_month[1].month )
|
navPointByMonthTag['id'] = "bda_%s-%s-ID" % (books_by_month[1].year,books_by_month[1].month )
|
||||||
navPointTag['playOrder'] = self.play_order
|
navPointTag['playOrder'] = self.play_order
|
||||||
self.play_order += 1
|
self.play_order += 1
|
||||||
@ -3524,7 +3545,8 @@ class CatalogBuilder(object):
|
|||||||
|
|
||||||
# --- Construct the 'Recently Read' *section* ---
|
# --- Construct the 'Recently Read' *section* ---
|
||||||
navPointTag = Tag(soup, 'navPoint')
|
navPointTag = Tag(soup, 'navPoint')
|
||||||
navPointTag['class'] = "section"
|
if self.generate_for_kindle_mobi:
|
||||||
|
navPointTag['class'] = "section"
|
||||||
file_ID = "%s" % tocTitle.lower()
|
file_ID = "%s" % tocTitle.lower()
|
||||||
file_ID = file_ID.replace(" ","")
|
file_ID = file_ID.replace(" ","")
|
||||||
navPointTag['id'] = "%s-ID" % file_ID
|
navPointTag['id'] = "%s-ID" % file_ID
|
||||||
@ -3594,7 +3616,8 @@ class CatalogBuilder(object):
|
|||||||
for books_by_day in master_day_list:
|
for books_by_day in master_day_list:
|
||||||
datestr = strftime(u'%A, %B %d', books_by_day[1].timetuple())
|
datestr = strftime(u'%A, %B %d', books_by_day[1].timetuple())
|
||||||
navPointByDayTag = Tag(soup, 'navPoint')
|
navPointByDayTag = Tag(soup, 'navPoint')
|
||||||
navPointByDayTag['class'] = "article"
|
if self.generate_for_kindle_mobi:
|
||||||
|
navPointByDayTag['class'] = "article"
|
||||||
navPointByDayTag['id'] = "bdr_%s-%s-%sID" % (books_by_day[1].year,
|
navPointByDayTag['id'] = "bdr_%s-%s-%sID" % (books_by_day[1].year,
|
||||||
books_by_day[1].month,
|
books_by_day[1].month,
|
||||||
books_by_day[1].day )
|
books_by_day[1].day )
|
||||||
@ -3662,7 +3685,8 @@ class CatalogBuilder(object):
|
|||||||
|
|
||||||
# --- Construct the 'Books By Genre' *section* ---
|
# --- Construct the 'Books By Genre' *section* ---
|
||||||
navPointTag = Tag(ncx_soup, 'navPoint')
|
navPointTag = Tag(ncx_soup, 'navPoint')
|
||||||
navPointTag['class'] = "section"
|
if self.generate_for_kindle_mobi:
|
||||||
|
navPointTag['class'] = "section"
|
||||||
file_ID = "%s" % tocTitle.lower()
|
file_ID = "%s" % tocTitle.lower()
|
||||||
file_ID = file_ID.replace(" ","")
|
file_ID = file_ID.replace(" ","")
|
||||||
navPointTag['id'] = "%s-ID" % file_ID
|
navPointTag['id'] = "%s-ID" % file_ID
|
||||||
@ -3684,7 +3708,8 @@ class CatalogBuilder(object):
|
|||||||
for genre in self.genres:
|
for genre in self.genres:
|
||||||
# Add an article for each genre
|
# Add an article for each genre
|
||||||
navPointVolumeTag = Tag(ncx_soup, 'navPoint')
|
navPointVolumeTag = Tag(ncx_soup, 'navPoint')
|
||||||
navPointVolumeTag['class'] = "article"
|
if self.generate_for_kindle_mobi:
|
||||||
|
navPointVolumeTag['class'] = "article"
|
||||||
navPointVolumeTag['id'] = "genre-%s-ID" % genre['tag']
|
navPointVolumeTag['id'] = "genre-%s-ID" % genre['tag']
|
||||||
navPointVolumeTag['playOrder'] = self.play_order
|
navPointVolumeTag['playOrder'] = self.play_order
|
||||||
self.play_order += 1
|
self.play_order += 1
|
||||||
@ -3823,12 +3848,13 @@ class CatalogBuilder(object):
|
|||||||
manifest.insert(mtc, itemTag)
|
manifest.insert(mtc, itemTag)
|
||||||
mtc += 1
|
mtc += 1
|
||||||
|
|
||||||
itemTag = Tag(soup, "item")
|
if self.generate_for_kindle_mobi:
|
||||||
itemTag['id'] = 'mastheadimage-image'
|
itemTag = Tag(soup, "item")
|
||||||
itemTag['href'] = "images/mastheadImage.gif"
|
itemTag['id'] = 'mastheadimage-image'
|
||||||
itemTag['media-type'] = 'image/gif'
|
itemTag['href'] = "images/mastheadImage.gif"
|
||||||
manifest.insert(mtc, itemTag)
|
itemTag['media-type'] = 'image/gif'
|
||||||
mtc += 1
|
manifest.insert(mtc, itemTag)
|
||||||
|
mtc += 1
|
||||||
|
|
||||||
# Write the thumbnail images, descriptions to the manifest
|
# Write the thumbnail images, descriptions to the manifest
|
||||||
sort_descriptions_by = []
|
sort_descriptions_by = []
|
||||||
@ -3914,11 +3940,12 @@ class CatalogBuilder(object):
|
|||||||
stc += 1
|
stc += 1
|
||||||
|
|
||||||
# Guide
|
# Guide
|
||||||
referenceTag = Tag(soup, "reference")
|
if self.generate_for_kindle_mobi:
|
||||||
referenceTag['type'] = 'masthead'
|
referenceTag = Tag(soup, "reference")
|
||||||
referenceTag['title'] = 'mastheadimage-image'
|
referenceTag['type'] = 'masthead'
|
||||||
referenceTag['href'] = 'images/mastheadImage.gif'
|
referenceTag['title'] = 'mastheadimage-image'
|
||||||
guide.insert(0,referenceTag)
|
referenceTag['href'] = 'images/mastheadImage.gif'
|
||||||
|
guide.insert(0,referenceTag)
|
||||||
|
|
||||||
# Write the OPF file
|
# Write the OPF file
|
||||||
outfile = open("%s/%s.opf" % (self.catalog_path, self.opts.basename), 'w')
|
outfile = open("%s/%s.opf" % (self.catalog_path, self.opts.basename), 'w')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user