Fix for anthology titles (and generate cover settings) not needing encode() anymore.

This commit is contained in:
Jim Miller 2019-05-06 14:15:58 -05:00
parent 08bed37eba
commit 0bbe27b9e9

View file

@ -2240,7 +2240,7 @@ class FanFicFarePlugin(InterfaceAction):
# if "=>" in line:
# (template,regexp,setting) = map( lambda x: x.strip(), line.split("=>") )
for (template,regexp,setting) in configuration.get_generate_cover_settings():
value = Template(template).safe_substitute(book['all_metadata']).encode('utf8')
value = Template(template).safe_substitute(book['all_metadata'])
# print("%s(%s) => %s => %s"%(template,value,regexp,setting))
if re.search(regexp,value):
setting_name = setting
@ -2669,7 +2669,7 @@ class FanFicFarePlugin(InterfaceAction):
logger.debug("anthology_title_pattern:%s"%configuration.getConfig('anthology_title_pattern'))
if configuration.getConfig('anthology_title_pattern'):
tmplt = Template(configuration.getConfig('anthology_title_pattern'))
book['title'] = tmplt.safe_substitute({'title':book['title']}).encode('utf8')
book['title'] = tmplt.safe_substitute({'title':book['title']})
else:
# No setting, do fall back default. Shouldn't happen,
# should always have a version in defaults.