Fix empty Genre parsing for adapter_ficwadcom

This commit is contained in:
Jim Miller 2018-09-04 12:41:52 -05:00
parent 124eb4da85
commit 30006698ad

View file

@ -169,7 +169,9 @@ class FicwadComSiteAdapter(BaseSiteAdapter):
if m:
self.story.setMetadata('rating', m.group(1))
m = re.match(r".*?Genres: (.+?) -.*?",metastr)
## Genre appears even if list is empty. But there are a
## limited number of genres allowed by the site.
m = re.match(r".*?Genres: ((?:(?:Angst|Crossover|Drama|Erotica|Fantasy|Horror|Humor|Parody|Romance|Sci-fi)(?:,)?)+) -.*?",metastr)
if m:
for g in m.group(1).split(','):
self.story.addToList('genre',g)