mirror of https://gitlab.com/bashrc2/epicyon
Check that properties exist
parent
b2f9a046ed
commit
838868e811
|
@ -226,12 +226,12 @@ def _add_newswire_dict_entry(base_dir: str, domain: str,
|
||||||
# extract hashtags from the text of the feed post
|
# extract hashtags from the text of the feed post
|
||||||
post_tags = get_newswire_tags(all_text, max_tags)
|
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
|
# Include tags from podcast categories
|
||||||
if podcast_properties:
|
if podcast_properties:
|
||||||
|
if podcast_properties.get('explicit'):
|
||||||
|
if '#NSFW' not in post_tags:
|
||||||
|
post_tags.append('#NSFW')
|
||||||
|
|
||||||
post_tags += podcast_properties['categories']
|
post_tags += podcast_properties['categories']
|
||||||
|
|
||||||
# combine the tags into a single list
|
# combine the tags into a single list
|
||||||
|
|
|
@ -23,6 +23,8 @@ from webapp_utils import html_keyboard_navigation
|
||||||
def _html_podcast_performers(podcast_properties: {}) -> str:
|
def _html_podcast_performers(podcast_properties: {}) -> str:
|
||||||
"""Returns html for performers of a podcast
|
"""Returns html for performers of a podcast
|
||||||
"""
|
"""
|
||||||
|
if not podcast_properties:
|
||||||
|
return ''
|
||||||
if not podcast_properties.get('persons'):
|
if not podcast_properties.get('persons'):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
@ -72,6 +74,8 @@ def _html_podcast_soundbites(link_url: str, extension: str,
|
||||||
translate: {}) -> str:
|
translate: {}) -> str:
|
||||||
"""Returns html for podcast soundbites
|
"""Returns html for podcast soundbites
|
||||||
"""
|
"""
|
||||||
|
if not podcast_properties:
|
||||||
|
return ''
|
||||||
if not podcast_properties.get('soundbites'):
|
if not podcast_properties.get('soundbites'):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue