Fixing author name in json feeds.

This commit is contained in:
Samuel Clay 2021-07-29 17:27:53 -04:00
parent 6286b798a7
commit d7c8f5f79c

View file

@ -45,7 +45,7 @@ class JSONFetcher:
date_published = dateutil.parser.parse(pubdate) date_published = dateutil.parser.parse(pubdate)
authors = item.get('authors', item.get('author', {})) authors = item.get('authors', item.get('author', {}))
if isinstance(authors, list): if isinstance(authors, list):
author_name = [author.get('name', "") for author in authors] author_name = ', '.join([author.get('name', "") for author in authors])
else: else:
author_name = authors.get('name', "") author_name = authors.get('name', "")
story = { story = {