Skip to content
Snippets Groups Projects
Commit 12b22008 authored by Yassine Doghri's avatar Yassine Doghri
Browse files

fix(socialinteract): move social interact uri into uri attribute + update social data upon import

parent c220b310
No related branches found
No related tags found
No related merge requests found
...@@ -320,9 +320,10 @@ if (! function_exists('get_rss_feed')) { ...@@ -320,9 +320,10 @@ if (! function_exists('get_rss_feed')) {
$comments->addAttribute('contentType', 'application/podcast-activity+json'); $comments->addAttribute('contentType', 'application/podcast-activity+json');
if ($episode->getPosts()) { if ($episode->getPosts()) {
$socialInteractUrl = $episode->getPosts()[0] $socialInteractUri = $episode->getPosts()[0]
->uri; ->uri;
$socialInteractElement = $item->addChild('socialInteract', $socialInteractUrl, $podcastNamespace); $socialInteractElement = $item->addChild('socialInteract', null, $podcastNamespace);
$socialInteractElement->addAttribute('uri', $socialInteractUri);
$socialInteractElement->addAttribute('priority', '1'); $socialInteractElement->addAttribute('priority', '1');
$socialInteractElement->addAttribute('platform', 'castopod'); $socialInteractElement->addAttribute('platform', 'castopod');
$socialInteractElement->addAttribute('protocol', 'activitypub'); $socialInteractElement->addAttribute('protocol', 'activitypub');
......
...@@ -211,14 +211,20 @@ class PodcastImportController extends BaseController ...@@ -211,14 +211,20 @@ class PodcastImportController extends BaseController
[ [
'name' => 'podcasting', 'name' => 'podcasting',
'elements' => $nsPodcast->id, 'elements' => $nsPodcast->id,
'account_url_key' => 'url',
'account_id_key' => 'id',
], ],
[ [
'name' => 'social', 'name' => 'social',
'elements' => $nsPodcast->social, 'elements' => $nsPodcast->social,
'account_url_key' => 'accountUrl',
'account_id_key' => 'accountId',
], ],
[ [
'name' => 'funding', 'name' => 'funding',
'elements' => $nsPodcast->funding, 'elements' => $nsPodcast->funding,
'account_url_key' => 'url',
'account_id_key' => 'id',
], ],
]; ];
$platformModel = new PlatformModel(); $platformModel = new PlatformModel();
...@@ -230,8 +236,8 @@ class PodcastImportController extends BaseController ...@@ -230,8 +236,8 @@ class PodcastImportController extends BaseController
$podcastsPlatformsData[] = [ $podcastsPlatformsData[] = [
'platform_slug' => $platformSlug, 'platform_slug' => $platformSlug,
'podcast_id' => $newPodcastId, 'podcast_id' => $newPodcastId,
'link_url' => $platform->attributes()['url'], 'link_url' => $platform->attributes()[$platformType['account_url_key']],
'account_id' => $platform->attributes()['id'], 'account_id' => $platform->attributes()[$platformType['account_id_key']],
'is_visible' => false, 'is_visible' => false,
]; ];
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment