From 08e5f5ba8f250640b398f3b0900ab3b812621f5d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 16 Feb 2022 13:27:11 +0000 Subject: [PATCH] Additional fields for podcast interaction --- newswire.py | 3 ++- webapp_podcast.py | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/newswire.py b/newswire.py index 9994efde5..36097404d 100644 --- a/newswire.py +++ b/newswire.py @@ -514,7 +514,8 @@ def xml_podcast_to_dict(base_dir: str, xml_item: str, xml_str: str) -> {}: 'owner', 'srcset', 'img', 'role', 'address', 'suggested', 'startTime', 'duration', 'href', 'name', 'pubdate', 'length', 'season', 'email', 'platform', 'protocol', - 'accountId', 'priority' + 'accountId', 'priority', 'podcastAccountId', + 'podcastAccountUrl' ) pod_entry = {} for pod_field in pod_fields: diff --git a/webapp_podcast.py b/webapp_podcast.py index bdfc85df6..cac8fcf23 100644 --- a/webapp_podcast.py +++ b/webapp_podcast.py @@ -34,8 +34,14 @@ def _html_podcast_social_interactions(podcast_properties: {}, return '' episode_post_url = podcast_properties['socialInteract']['text'] actor_str = '' + podcast_account_id = None if podcast_properties['socialInteract'].get('accountId'): - actor_handle = podcast_properties['socialInteract']['accountId'] + podcast_account_id = podcast_properties['socialInteract']['accountId'] + elif podcast_properties['socialInteract'].get('podcastAccountUrl'): + podcast_account_id = \ + podcast_properties['socialInteract']['podcastAccountUrl'] + if podcast_account_id: + actor_handle = podcast_account_id if actor_handle.startswith('@'): actor_handle = actor_handle[1:] actor_str = '?actor=' + actor_handle