Fix category and tags for search

This commit is contained in:
Jesús
2020-06-13 19:43:09 -05:00
parent df45d91a9c
commit 669b9c43fa
2 changed files with 14 additions and 2 deletions

View File

@@ -109,9 +109,14 @@ class Tipue_Search_JSON_Generator(object):
video_src = article.og_video if getattr(
article, 'og_video', 'None') != 'None' else ''
# category
video_category = article.category.name if getattr(
article, 'category', 'None') != 'None' else ''
# tags
data_tags = ['%s' % (tag) for tag in article.tags]
video_tags = dict((num, tag) for num, tag in enumerate(data_tags))
node = {'title': video_title,
'description': video_text,
'videoThumbnail': url_image,
@@ -123,7 +128,8 @@ class Tipue_Search_JSON_Generator(object):
'published': video_publish,
'publishedText': video_publish_text,
'time': video_time,
'tags': video_category,
'category': video_category,
'keywords': video_tags,
'url': video_url}
self.json_nodes.append(node)