Commit c0a22829 authored by Benjamin Bellamy's avatar Benjamin Bellamy 💬
Browse files

feat(rss): add podcast:location tag

parent ba088649
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -126,6 +126,7 @@ class Episode extends BaseController
            'enclosure' => $this->request->getFile('enclosure'),
            'description_markdown' => $this->request->getPost('description'),
            'image' => $this->request->getFile('image'),
            'location' => $this->request->getPost('location_name'),
            'transcript' => $this->request->getFile('transcript'),
            'chapters' => $this->request->getFile('chapters'),
            'parental_advisory' =>
@@ -222,6 +223,7 @@ class Episode extends BaseController
        $this->episode->description_markdown = $this->request->getPost(
            'description'
        );
        $this->episode->location = $this->request->getPost('location_name');
        $this->episode->parental_advisory =
            $this->request->getPost('parental_advisory') !== 'undefined'
                ? $this->request->getPost('parental_advisory')
+2 −0
Original line number Diff line number Diff line
@@ -161,6 +161,7 @@ class Podcast extends BaseController
            'publisher' => $this->request->getPost('publisher'),
            'type' => $this->request->getPost('type'),
            'copyright' => $this->request->getPost('copyright'),
            'location' => $this->request->getPost('location_name'),
            'payment_pointer' => $this->request->getPost('payment_pointer'),
            'is_blocked' => $this->request->getPost('is_blocked') === 'yes',
            'is_completed' => $this->request->getPost('complete') === 'yes',
@@ -254,6 +255,7 @@ class Podcast extends BaseController
        $this->podcast->owner_email = $this->request->getPost('owner_email');
        $this->podcast->type = $this->request->getPost('type');
        $this->podcast->copyright = $this->request->getPost('copyright');
        $this->podcast->location = $this->request->getPost('location_name');
        $this->podcast->payment_pointer = $this->request->getPost(
            'payment_pointer'
        );
+36 −5
Original line number Diff line number Diff line
@@ -121,9 +121,11 @@ class PodcastImport extends BaseController
                    $channelDescriptionHtml
                ),
                'description_html' => $channelDescriptionHtml,
                'image' => $nsItunes->image && !empty($nsItunes->image->attributes())
                'image' =>
                    $nsItunes->image && !empty($nsItunes->image->attributes())
                        ? download_file($nsItunes->image->attributes())
                    : ($feed->channel[0]->image && !empty($feed->channel[0]->image->url)
                        : ($feed->channel[0]->image &&
                        !empty($feed->channel[0]->image->url)
                            ? download_file($feed->channel[0]->image->url)
                            : null),
                'language_code' => $this->request->getPost('language'),
@@ -146,6 +148,19 @@ class PodcastImport extends BaseController
                'is_completed' => empty($nsItunes->complete)
                    ? false
                    : $nsItunes->complete === 'yes',
                'location_name' => !$nsPodcast->location
                    ? null
                    : $nsPodcast->location->attributes()['name'],
                'location_geo' =>
                    !$nsPodcast->location ||
                    empty($nsPodcast->location->attributes()['geo'])
                        ? null
                        : $nsPodcast->location->attributes()['geo'],
                'location_osmid' =>
                    !$nsPodcast->location ||
                    empty($nsPodcast->location->attributes()['osmid'])
                        ? null
                        : $nsPodcast->location->attributes()['osmid'],
                'created_by' => user(),
                'updated_by' => user(),
            ]);
@@ -243,6 +258,9 @@ class PodcastImport extends BaseController
            $nsItunes = $item->children(
                'http://www.itunes.com/dtds/podcast-1.0.dtd'
            );
            $nsPodcast = $item->children(
                'https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md'
            );

            $slug = slugify(
                $this->request->getPost('slug_field') === 'title'
@@ -306,6 +324,19 @@ class PodcastImport extends BaseController
                'is_blocked' => empty($nsItunes->block)
                    ? false
                    : $nsItunes->block === 'yes',
                'location_name' => !$nsPodcast->location
                    ? null
                    : $nsPodcast->location->attributes()['name'],
                'location_geo' =>
                    !$nsPodcast->location ||
                    empty($nsPodcast->location->attributes()['geo'])
                        ? null
                        : $nsPodcast->location->attributes()['geo'],
                'location_osmid' =>
                    !$nsPodcast->location ||
                    empty($nsPodcast->location->attributes()['osmid'])
                        ? null
                        : $nsPodcast->location->attributes()['osmid'],
                'created_by' => user(),
                'updated_by' => user(),
                'published_at' => strtotime($item->pubDate),
+15 −0
Original line number Diff line number Diff line
@@ -123,6 +123,21 @@ class AddPodcasts extends Migration
                'comment' => 'Wallet address for Web Monetization payments',
                'null' => true,
            ],
            'location_name' => [
                'type' => 'VARCHAR',
                'constraint' => 128,
                'null' => true,
            ],
            'location_geo' => [
                'type' => 'VARCHAR',
                'constraint' => 32,
                'null' => true,
            ],
            'location_osmid' => [
                'type' => 'VARCHAR',
                'constraint' => 12,
                'null' => true,
            ],
            'created_by' => [
                'type' => 'INT',
                'unsigned' => true,
+15 −0
Original line number Diff line number Diff line
@@ -109,6 +109,21 @@ class AddEpisodes extends Migration
                'constraint' => 1,
                'default' => 0,
            ],
            'location_name' => [
                'type' => 'VARCHAR',
                'constraint' => 128,
                'null' => true,
            ],
            'location_geo' => [
                'type' => 'VARCHAR',
                'constraint' => 32,
                'null' => true,
            ],
            'location_osmid' => [
                'type' => 'VARCHAR',
                'constraint' => 12,
                'null' => true,
            ],
            'created_by' => [
                'type' => 'INT',
                'unsigned' => true,
Loading