Loading app/Database/Migrations/2023-12-29-150000_add_podcasts_owner_email_feed.php 0 → 100644 +36 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); /** * Class AddPodcastsOwnerEmailRemovedFromFeed adds is_owner_email_removed_from_feed field to podcast table in database * * @copyright 2020 Ad Aures * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @link https://castopod.org/ */ namespace App\Database\Migrations; class AddPodcastsOwnerEmailRemovedFromFeed extends BaseMigration { public function up(): void { $fields = [ 'is_owner_email_removed_from_feed' => [ 'type' => 'BOOLEAN', 'null' => false, 'default' => 0, 'after' => 'owner_email', ], ]; $this->forge->addColumn('podcasts', $fields); } public function down(): void { $fields = ['is_owner_email_removed_from_feed']; $this->forge->dropColumn('podcasts', $fields); } } app/Entities/Podcast.php +2 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ use RuntimeException; * @property string|null $publisher * @property string $owner_name * @property string $owner_email * @property bool $is_owner_email_removed_from_feed * @property string $type * @property string|null $copyright * @property string|null $episode_description_footer_markdown Loading Loading @@ -191,6 +192,7 @@ class Podcast extends Entity 'publisher' => '?string', 'owner_name' => 'string', 'owner_email' => 'string', 'is_owner_email_removed_from_feed' => 'boolean', 'type' => 'string', 'copyright' => '?string', 'episode_description_footer_markdown' => '?string', Loading app/Helpers/rss_helper.php +12 −4 Original line number Diff line number Diff line Loading @@ -101,9 +101,15 @@ if (! function_exists('get_rss_feed')) { $recipientElement->addAttribute('split', '100'); } if ($podcast->is_owner_email_removed_from_feed) { $channel ->addChild('locked', $podcast->is_locked ? 'yes' : 'no', $podcastNamespace); } else { $channel ->addChild('locked', $podcast->is_locked ? 'yes' : 'no', $podcastNamespace) ->addAttribute('owner', $podcast->owner_email); } if ($podcast->imported_feed_url !== null) { $channel->addChild('previousUrl', $podcast->imported_feed_url, $podcastNamespace); } Loading Loading @@ -249,7 +255,9 @@ if (! function_exists('get_rss_feed')) { $owner->addChild('name', $podcast->owner_name, $itunesNamespace, false); if (! $podcast->is_owner_email_removed_from_feed) { $owner->addChild('email', $podcast->owner_email, $itunesNamespace); } $channel->addChild('type', $podcast->type, $itunesNamespace); $podcast->copyright && Loading app/Models/PodcastModel.php +1 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ class PodcastModel extends Model 'parental_advisory', 'owner_name', 'owner_email', 'is_owner_email_removed_from_feed', 'publisher', 'type', 'copyright', Loading modules/Admin/Controllers/PodcastController.php +7 −6 Original line number Diff line number Diff line Loading @@ -216,6 +216,7 @@ class PodcastController extends BaseController : null, 'owner_name' => $this->request->getPost('owner_name'), 'owner_email' => $this->request->getPost('owner_email'), 'is_owner_email_removed_from_feed' => $this->request->getPost('is_owner_email_removed_from_feed') === 'yes', 'publisher' => $this->request->getPost('publisher'), 'type' => $this->request->getPost('type'), 'copyright' => $this->request->getPost('copyright'), Loading Loading
app/Database/Migrations/2023-12-29-150000_add_podcasts_owner_email_feed.php 0 → 100644 +36 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); /** * Class AddPodcastsOwnerEmailRemovedFromFeed adds is_owner_email_removed_from_feed field to podcast table in database * * @copyright 2020 Ad Aures * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @link https://castopod.org/ */ namespace App\Database\Migrations; class AddPodcastsOwnerEmailRemovedFromFeed extends BaseMigration { public function up(): void { $fields = [ 'is_owner_email_removed_from_feed' => [ 'type' => 'BOOLEAN', 'null' => false, 'default' => 0, 'after' => 'owner_email', ], ]; $this->forge->addColumn('podcasts', $fields); } public function down(): void { $fields = ['is_owner_email_removed_from_feed']; $this->forge->dropColumn('podcasts', $fields); } }
app/Entities/Podcast.php +2 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ use RuntimeException; * @property string|null $publisher * @property string $owner_name * @property string $owner_email * @property bool $is_owner_email_removed_from_feed * @property string $type * @property string|null $copyright * @property string|null $episode_description_footer_markdown Loading Loading @@ -191,6 +192,7 @@ class Podcast extends Entity 'publisher' => '?string', 'owner_name' => 'string', 'owner_email' => 'string', 'is_owner_email_removed_from_feed' => 'boolean', 'type' => 'string', 'copyright' => '?string', 'episode_description_footer_markdown' => '?string', Loading
app/Helpers/rss_helper.php +12 −4 Original line number Diff line number Diff line Loading @@ -101,9 +101,15 @@ if (! function_exists('get_rss_feed')) { $recipientElement->addAttribute('split', '100'); } if ($podcast->is_owner_email_removed_from_feed) { $channel ->addChild('locked', $podcast->is_locked ? 'yes' : 'no', $podcastNamespace); } else { $channel ->addChild('locked', $podcast->is_locked ? 'yes' : 'no', $podcastNamespace) ->addAttribute('owner', $podcast->owner_email); } if ($podcast->imported_feed_url !== null) { $channel->addChild('previousUrl', $podcast->imported_feed_url, $podcastNamespace); } Loading Loading @@ -249,7 +255,9 @@ if (! function_exists('get_rss_feed')) { $owner->addChild('name', $podcast->owner_name, $itunesNamespace, false); if (! $podcast->is_owner_email_removed_from_feed) { $owner->addChild('email', $podcast->owner_email, $itunesNamespace); } $channel->addChild('type', $podcast->type, $itunesNamespace); $podcast->copyright && Loading
app/Models/PodcastModel.php +1 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ class PodcastModel extends Model 'parental_advisory', 'owner_name', 'owner_email', 'is_owner_email_removed_from_feed', 'publisher', 'type', 'copyright', Loading
modules/Admin/Controllers/PodcastController.php +7 −6 Original line number Diff line number Diff line Loading @@ -216,6 +216,7 @@ class PodcastController extends BaseController : null, 'owner_name' => $this->request->getPost('owner_name'), 'owner_email' => $this->request->getPost('owner_email'), 'is_owner_email_removed_from_feed' => $this->request->getPost('is_owner_email_removed_from_feed') === 'yes', 'publisher' => $this->request->getPost('publisher'), 'type' => $this->request->getPost('type'), 'copyright' => $this->request->getPost('copyright'), Loading