diff --git a/app/Database/Migrations/2024-02-05-160000_add_podcasts_medium.php b/app/Database/Migrations/2024-02-05-160000_add_podcasts_medium.php new file mode 100644 index 00000000..1ea78d38 --- /dev/null +++ b/app/Database/Migrations/2024-02-05-160000_add_podcasts_medium.php @@ -0,0 +1,36 @@ + [ + 'type' => "ENUM('podcast','music','audiobook')", + 'null' => false, + 'default' => 'podcast', + 'after' => 'type', + ], + ]; + + $this->forge->addColumn('podcasts', $fields); + } + + public function down(): void + { + $fields = ['medium']; + $this->forge->dropColumn('podcasts', $fields); + } +} diff --git a/app/Entities/Podcast.php b/app/Entities/Podcast.php index ce4226aa..eff4364b 100644 --- a/app/Entities/Podcast.php +++ b/app/Entities/Podcast.php @@ -64,6 +64,7 @@ use RuntimeException; * @property string $owner_email * @property bool $is_owner_email_removed_from_feed * @property string $type + * @property string $medium * @property string|null $copyright * @property string|null $episode_description_footer_markdown * @property string|null $episode_description_footer_html @@ -196,6 +197,7 @@ class Podcast extends Entity 'owner_email' => 'string', 'is_owner_email_removed_from_feed' => 'boolean', 'type' => 'string', + 'medium' => 'string', 'copyright' => '?string', 'episode_description_footer_markdown' => '?string', 'episode_description_footer_html' => '?string', diff --git a/app/Helpers/rss_helper.php b/app/Helpers/rss_helper.php index ddcdf36c..bde1f11d 100644 --- a/app/Helpers/rss_helper.php +++ b/app/Helpers/rss_helper.php @@ -74,6 +74,8 @@ if (! function_exists('get_rss_feed')) { $channel->addChild('title', $podcast->title, null, false); $channel->addChildWithCDATA('description', $podcast->description_html); + $channel->addChild('medium', $podcast->medium, $podcastNamespace); + $itunesImage = $channel->addChild('image', null, $itunesNamespace); $itunesImage->addAttribute('href', $podcast->cover->feed_url); diff --git a/app/Models/PodcastModel.php b/app/Models/PodcastModel.php index 9c228e1d..9dd3763a 100644 --- a/app/Models/PodcastModel.php +++ b/app/Models/PodcastModel.php @@ -51,6 +51,7 @@ class PodcastModel extends Model 'is_owner_email_removed_from_feed', 'publisher', 'type', + 'medium', 'copyright', 'imported_feed_url', 'new_feed_url', diff --git a/modules/Admin/Controllers/PodcastController.php b/modules/Admin/Controllers/PodcastController.php index 4ac1157f..bc483235 100644 --- a/modules/Admin/Controllers/PodcastController.php +++ b/modules/Admin/Controllers/PodcastController.php @@ -219,6 +219,7 @@ class PodcastController extends BaseController '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'), + 'medium' => $this->request->getPost('medium'), 'copyright' => $this->request->getPost('copyright'), 'location' => $this->request->getPost('location_name') === '' ? null : new Location( $this->request->getPost('location_name') @@ -314,6 +315,7 @@ class PodcastController extends BaseController $this->podcast->owner_name = $this->request->getPost('owner_name'); $this->podcast->owner_email = $this->request->getPost('owner_email'); $this->podcast->type = $this->request->getPost('type'); + $this->podcast->medium = $this->request->getPost('medium'); $this->podcast->copyright = $this->request->getPost('copyright'); $this->podcast->location = $this->request->getPost('location_name') === '' ? null : new Location( $this->request->getPost('location_name') diff --git a/modules/Admin/Language/en/Podcast.php b/modules/Admin/Language/en/Podcast.php index 3a2edc64..d02b6cf4 100644 --- a/modules/Admin/Language/en/Podcast.php +++ b/modules/Admin/Language/en/Podcast.php @@ -74,7 +74,17 @@ return [ 'episodic' => 'Episodic', 'episodic_hint' => 'If episodes are intended to be consumed without any specific order. Newest episodes will be presented first.', 'serial' => 'Serial', - 'serial_hint' => 'If episodes are intended to be consumed in sequential order. The oldest episodes will be presented first.', + 'serial_hint' => 'If episodes are intended to be consumed in sequential order. Episodes will be presented in numeric order.', + ], + 'medium' => [ + 'label' => 'Medium', + 'hint' => 'Medium as represented by podcast:medium tag in RSS. Changing this may change how players present your feed.', + 'podcast' => 'Podcast', + 'podcast_hint' => 'Describes a feed for a podcast show.', + 'music' => 'Music', + 'music_hint' => 'A feed of music organized into an "album" with each item a song within the album.', + 'audiobook' => 'Audiobook', + 'audiobook_hint' => 'Specific types of audio with one item per feed, or where items represent chapters within the book.', ], 'description' => 'Description', 'classification_section_title' => 'Classification', diff --git a/themes/cp_admin/podcast/create.php b/themes/cp_admin/podcast/create.php index 54ab5287..7f09adf0 100644 --- a/themes/cp_admin/podcast/create.php +++ b/themes/cp_admin/podcast/create.php @@ -56,6 +56,26 @@ isChecked="false" > +
+ +
+ + + +
+
+
+ +
+ + + +
+