Update socialInteract url from podcast spec

merge-requests/30/head
Bob Mottram 2022-04-21 10:21:25 +01:00
parent ea705c539b
commit f052cabca5
2 changed files with 17 additions and 5 deletions

View File

@ -473,10 +473,17 @@ def _valid_podcast_entry(base_dir: str, key: str, entry: {}) -> bool:
if key == 'socialInteract':
if not entry.get('protocol'):
return False
if not entry.get('uri'):
if not entry.get('text'):
if not entry.get('url'):
return False
if entry['protocol'].tolower() != 'activitypub':
return False
if entry.get('uri'):
post_url = entry['uri']
elif entry.get('url'):
post_url = entry['uri']
else:
post_url = entry['text']
if '://' not in post_url:
return False

View File

@ -30,9 +30,14 @@ def _html_podcast_social_interactions(podcast_properties: {},
return ''
if not podcast_properties.get('socialInteract'):
return ''
if not podcast_properties['socialInteract'].get('text'):
return ''
if podcast_properties['socialInteract'].get('uri'):
episode_post_url = podcast_properties['socialInteract']['uri']
elif podcast_properties['socialInteract'].get('url'):
episode_post_url = podcast_properties['socialInteract']['url']
elif podcast_properties['socialInteract'].get('text'):
episode_post_url = podcast_properties['socialInteract']['text']
else:
return ''
actor_str = ''
podcast_account_id = None
if podcast_properties['socialInteract'].get('accountId'):