Graceful fail for 'k'HTML when no 'k'Url, bump min calibre version.

This commit is contained in:
Jim Miller 2013-12-11 12:14:55 -06:00
parent fcbfe96c64
commit 7c9c84256c
2 changed files with 9 additions and 4 deletions

View file

@ -42,8 +42,8 @@ class FanFictionDownLoaderBase(InterfaceActionBase):
description = _('UI plugin to download FanFiction stories from various sites.')
supported_platforms = ['windows', 'osx', 'linux']
author = 'Jim Miller'
version = (1, 8, 02)
minimum_calibre_version = (0, 8, 57)
version = (1, 8, 03)
minimum_calibre_version = (1, 13, 0)
#: This field defines the GUI plugin class that contains all the code
#: that actually does something. Its format is module_path:class_name

View file

@ -389,9 +389,14 @@ class Story(Configurable):
elif self.getMetadataRaw('series') != None:
self.setMetadata('seriesHTML',self.getMetadataRaw('series'))
# logger.debug("make_linkhtml_entries:%s"%self.getConfig('make_linkhtml_entries'))
for k in self.getConfigList('make_linkhtml_entries'):
# Assuming list, because it has to be site specific and
# they are all lists.
# they are all lists. Bail if kUrl list not the same
# length.
# logger.debug("\nk:%s\nlist:%s\nlistURL:%s"%(k,self.getList(k),self.getList(k+'Url')))
if len(self.getList(k+'Url')) != len(self.getList(k)):
continue
htmllist=[]
for i, v in enumerate(self.getList(k)):
url = self.getList(k+'Url')[i]
@ -403,7 +408,7 @@ class Story(Configurable):
url=removeAllEntities(url)
v=removeAllEntities(v)
htmllist.append(linkhtml%('author',url,v))
htmllist.append(linkhtml%(k,url,v))
join_string = self.getConfig("join_string_"+k+"HTML",u", ").replace('\s',' ')
self.setMetadata(k+'HTML',join_string.join(htmllist))