From de37c4aa1dffc0a066634a82c6ca03bc66a59c72 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Wed, 11 Jun 2014 19:12:59 -0500 Subject: [PATCH] Add '\,' split list feature for replace_metadata. \, will split into multiple. --- fanficdownloader/story.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fanficdownloader/story.py b/fanficdownloader/story.py index 8f0a574..a3fb60e 100644 --- a/fanficdownloader/story.py +++ b/fanficdownloader/story.py @@ -301,8 +301,7 @@ class Story(Configurable): self.logfile=None # cheesy way to carry log file forward across update. ## Look for config parameter, split and add each to metadata field. - for (config,metadata) in [("extratags","extratags"), - ("extracategories","category"), + for (config,metadata) in [("extracategories","category"), ("extragenres","genre"), ("extracharacters","characters"), ("extraships","ships"), @@ -435,6 +434,10 @@ class Story(Configurable): if doreplace: value = regexp.sub(replacement,value) + if self.isList(key) and '\,' in value: + l = value.split('\,') + value = l[0] + self.extendList(key,l[1:]) value = self.do_in_ex_clude('include_metadata_post',value,key) value = self.do_in_ex_clude('exclude_metadata_post',value,key) return value