Check that properties exist

merge-requests/22/merge
Bob Mottram 2022-01-13 23:06:04 +00:00
parent b2f9a046ed
commit 838868e811
2 changed files with 8 additions and 4 deletions

View File

@ -226,12 +226,12 @@ def _add_newswire_dict_entry(base_dir: str, domain: str,
# extract hashtags from the text of the feed post
post_tags = get_newswire_tags(all_text, max_tags)
if podcast_properties.get('explicit'):
if '#NSFW' not in post_tags:
post_tags.append('#NSFW')
# Include tags from podcast categories
if podcast_properties:
if podcast_properties.get('explicit'):
if '#NSFW' not in post_tags:
post_tags.append('#NSFW')
post_tags += podcast_properties['categories']
# combine the tags into a single list

View File

@ -23,6 +23,8 @@ from webapp_utils import html_keyboard_navigation
def _html_podcast_performers(podcast_properties: {}) -> str:
"""Returns html for performers of a podcast
"""
if not podcast_properties:
return ''
if not podcast_properties.get('persons'):
return ''
@ -72,6 +74,8 @@ def _html_podcast_soundbites(link_url: str, extension: str,
translate: {}) -> str:
"""Returns html for podcast soundbites
"""
if not podcast_properties:
return ''
if not podcast_properties.get('soundbites'):
return ''