Handle multiple categories per podcast item

main
Bob Mottram 2022-01-13 16:04:14 +00:00
parent 1587ec0404
commit 41ff8954d7
1 changed files with 29 additions and 21 deletions

View File

@ -397,12 +397,20 @@ def _get_podcast_categories(xml_item: str, xml_str: str) -> str:
continue
item_str = xml_str
episode_category = item_str.split(category_tag)[1]
category_list = item_str.split(category_tag)
first_category = True
for category_item in category_list:
if first_category:
first_category = False
continue
episode_category = category_item
if 'text="' in episode_category:
episode_category = episode_category.split('text="')[1]
if '"' in episode_category:
episode_category = episode_category.split('"')[0]
episode_category = episode_category.lower().replace(' ', '')
episode_category = \
episode_category.lower().replace(' ', '')
episode_category = episode_category.replace('#', '')
if episode_category not in podcast_categories:
if valid_hash_tag(episode_category):