diff --git a/app/Database/Migrations/2017-12-01-160000_add_podcasts_platforms.php b/app/Database/Migrations/2020-06-05-200000_add_podcasts_platforms.php similarity index 88% rename from app/Database/Migrations/2017-12-01-160000_add_podcasts_platforms.php rename to app/Database/Migrations/2020-06-05-200000_add_podcasts_platforms.php index febec481..8476dc0e 100644 --- a/app/Database/Migrations/2017-12-01-160000_add_podcasts_platforms.php +++ b/app/Database/Migrations/2020-06-05-200000_add_podcasts_platforms.php @@ -31,7 +31,7 @@ class AddPodcastsPlatforms extends Migration 'type' => 'VARCHAR', 'constraint' => 512, ], - 'link_content' => [ + 'account_id' => [ 'type' => 'VARCHAR', 'constraint' => 128, 'null' => true, @@ -49,6 +49,8 @@ class AddPodcastsPlatforms extends Migration ]); $this->forge->addPrimaryKey(['podcast_id', 'platform_slug']); + $this->forge->addForeignKey('podcast_id', 'podcasts', 'id', '', 'CASCADE'); + $this->forge->addForeignKey('platform_slug', 'platforms', 'slug', 'CASCADE'); $this->forge->createTable('podcasts_platforms'); } diff --git a/app/Entities/Platform.php b/app/Entities/Platform.php index 0d43f89f..899e9afc 100644 --- a/app/Entities/Platform.php +++ b/app/Entities/Platform.php @@ -19,7 +19,7 @@ use CodeIgniter\Entity\Entity; * @property string $home_url * @property string|null $submit_url * @property string|null $link_url - * @property string|null $link_content + * @property string|null $account_id * @property bool|null $is_visible * @property bool|null $is_on_embed */ @@ -35,7 +35,7 @@ class Platform extends Entity 'home_url' => 'string', 'submit_url' => '?string', 'link_url' => '?string', - 'link_content' => '?string', + 'account_id' => '?string', 'is_visible' => '?boolean', 'is_on_embed' => '?boolean', ]; diff --git a/app/Helpers/rss_helper.php b/app/Helpers/rss_helper.php index d3052098..1a85bb7f 100644 --- a/app/Helpers/rss_helper.php +++ b/app/Helpers/rss_helper.php @@ -93,8 +93,8 @@ if (! function_exists('get_rss_feed')) { foreach ($podcast->podcasting_platforms as $podcastingPlatform) { $podcastingPlatformElement = $channel->addChild('id', null, $podcastNamespace); $podcastingPlatformElement->addAttribute('platform', $podcastingPlatform->slug); - if ($podcastingPlatform->link_content !== null) { - $podcastingPlatformElement->addAttribute('id', $podcastingPlatform->link_content); + if ($podcastingPlatform->account_id !== null) { + $podcastingPlatformElement->addAttribute('id', $podcastingPlatform->account_id); } if ($podcastingPlatform->link_url !== null) { $podcastingPlatformElement->addAttribute('url', htmlspecialchars($podcastingPlatform->link_url)); @@ -102,11 +102,7 @@ if (! function_exists('get_rss_feed')) { } foreach ($podcast->social_platforms as $socialPlatform) { - $socialPlatformElement = $channel->addChild( - 'social', - $socialPlatform->link_content, - $podcastNamespace, - ); + $socialPlatformElement = $channel->addChild('social', $socialPlatform->account_id, $podcastNamespace,); $socialPlatformElement->addAttribute('platform', $socialPlatform->slug); if ($socialPlatform->link_url !== null) { $socialPlatformElement->addAttribute('url', htmlspecialchars($socialPlatform->link_url)); @@ -116,7 +112,7 @@ if (! function_exists('get_rss_feed')) { foreach ($podcast->funding_platforms as $fundingPlatform) { $fundingPlatformElement = $channel->addChild( 'funding', - $fundingPlatform->link_content, + $fundingPlatform->account_id, $podcastNamespace, ); $fundingPlatformElement->addAttribute('platform', $fundingPlatform->slug); diff --git a/app/Models/PlatformModel.php b/app/Models/PlatformModel.php index fb88923c..652f664d 100644 --- a/app/Models/PlatformModel.php +++ b/app/Models/PlatformModel.php @@ -102,7 +102,7 @@ class PlatformModel extends Model ! ($found = cache("podcast#{$podcastId}_platforms_{$platformType}_withLinks")) ) { $found = $this->select( - 'platforms.*, podcasts_platforms.link_url, podcasts_platforms.link_content, podcasts_platforms.is_visible, podcasts_platforms.is_on_embed', + 'platforms.*, podcasts_platforms.link_url, podcasts_platforms.account_id, podcasts_platforms.is_visible, podcasts_platforms.is_on_embed', ) ->join( 'podcasts_platforms', @@ -127,7 +127,7 @@ class PlatformModel extends Model $cacheName = "podcast#{$podcastId}_platforms_{$platformType}"; if (! ($found = cache($cacheName))) { $found = $this->select( - 'platforms.*, podcasts_platforms.link_url, podcasts_platforms.link_content, podcasts_platforms.is_visible, podcasts_platforms.is_on_embed', + 'platforms.*, podcasts_platforms.link_url, podcasts_platforms.account_id, podcasts_platforms.is_visible, podcasts_platforms.is_on_embed', ) ->join('podcasts_platforms', 'podcasts_platforms.platform_slug = platforms.slug') ->where('podcasts_platforms.podcast_id', $podcastId) diff --git a/app/Resources/icons/social/discord.svg b/app/Resources/icons/social/discord.svg old mode 100755 new mode 100644 index ad22eebd..52ee5fa3 --- a/app/Resources/icons/social/discord.svg +++ b/app/Resources/icons/social/discord.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/modules/Admin/Controllers/PodcastImportController.php b/modules/Admin/Controllers/PodcastImportController.php index a24af7fc..de9e90d9 100644 --- a/modules/Admin/Controllers/PodcastImportController.php +++ b/modules/Admin/Controllers/PodcastImportController.php @@ -227,7 +227,7 @@ class PodcastImportController extends BaseController 'platform_slug' => $platformSlug, 'podcast_id' => $newPodcastId, 'link_url' => $platform->attributes()['url'], - 'link_content' => $platform->attributes()['id'], + 'account_id' => $platform->attributes()['id'], 'is_visible' => false, ]; } diff --git a/modules/Admin/Controllers/PodcastPlatformController.php b/modules/Admin/Controllers/PodcastPlatformController.php index d22b626c..28879beb 100644 --- a/modules/Admin/Controllers/PodcastPlatformController.php +++ b/modules/Admin/Controllers/PodcastPlatformController.php @@ -81,7 +81,7 @@ class PodcastPlatformController extends BaseController 'platform_slug' => $platformSlug, 'podcast_id' => $this->podcast->id, 'link_url' => $podcastPlatformUrl, - 'link_content' => $podcastPlatform['content'], + 'account_id' => $podcastPlatform['account_id'], 'is_visible' => array_key_exists('visible', $podcastPlatform) && $podcastPlatform['visible'] === 'yes', diff --git a/themes/cp_admin/podcast/platforms.php b/themes/cp_admin/podcast/platforms.php index 7be39713..38d589d5 100644 --- a/themes/cp_admin/podcast/platforms.php +++ b/themes/cp_admin/podcast/platforms.php @@ -90,12 +90,11 @@ placeholder="https://…" /> type}") ?>" /> - - + diff --git a/themes/cp_app/podcast/_partials/funding_links_modal.php b/themes/cp_app/podcast/_partials/funding_links_modal.php index aff193c4..4c4a4cb4 100644 --- a/themes/cp_app/podcast/_partials/funding_links_modal.php +++ b/themes/cp_app/podcast/_partials/funding_links_modal.php @@ -21,7 +21,7 @@ is_visible): ?>