Avoid any double hashes

main
Bob Mottram 2022-01-13 15:18:39 +00:00
parent 373116e72c
commit 36a4cf3aad
1 changed files with 2 additions and 0 deletions

View File

@ -491,6 +491,7 @@ def xml_podcast_to_dict(xml_item: str, xml_str: str) -> {}:
if '"' in episode_category:
episode_category = episode_category.split('"')[0]
episode_category = episode_category.lower().replace(' ', '')
episode_category = episode_category.replace('#', '')
if episode_category not in podcast_categories:
if valid_hash_tag(episode_category):
podcast_categories.append('#' + episode_category)
@ -502,6 +503,7 @@ def xml_podcast_to_dict(xml_item: str, xml_str: str) -> {}:
episode_category = episode_category.split('<')[0]
episode_category = \
episode_category.lower().replace(' ', '')
episode_category = episode_category.replace('#', '')
if episode_category not in podcast_categories:
if valid_hash_tag(episode_category):
podcast_categories.append('#' + episode_category)