Commit 96a6026f authored by Benjamin Bellamy's avatar Benjamin Bellamy 💬
Browse files

feat(monetization): add Web Monetization support

parent e8771755
Loading
Loading
Loading
Loading
Loading
+4 −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'),
            'payment_pointer' => $this->request->getPost('payment_pointer'),
            'is_blocked' => $this->request->getPost('is_blocked') === 'yes',
            'is_completed' => $this->request->getPost('complete') === 'yes',
            'is_locked' => $this->request->getPost('lock') === 'yes',
@@ -253,6 +254,9 @@ 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->payment_pointer = $this->request->getPost(
            'payment_pointer'
        );
        $this->podcast->is_blocked =
            $this->request->getPost('is_blocked') === 'yes';
        $this->podcast->is_completed =
+6 −0
Original line number Diff line number Diff line
@@ -117,6 +117,12 @@ class AddPodcasts extends Migration
                    'The RSS new feed URL if this podcast is moving out, NULL otherwise.',
                'null' => true,
            ],
            'payment_pointer' => [
                'type' => 'VARCHAR',
                'constraint' => 128,
                'comment' => 'Wallet address for Web Monetization payments',
                'null' => true,
            ],
            'created_by' => [
                'type' => 'INT',
                'unsigned' => true,
+1 −0
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ class Podcast extends Entity
        'is_locked' => 'boolean',
        'imported_feed_url' => '?string',
        'new_feed_url' => '?string',
        'payment_pointer' => '?string',
        'created_by' => 'integer',
        'updated_by' => 'integer',
    ];
+8 −0
Original line number Diff line number Diff line
@@ -65,6 +65,14 @@ function get_rss_feed($podcast, $serviceName = '')
    $itunes_image = $channel->addChild('image', null, $itunes_namespace);
    $itunes_image->addAttribute('href', $podcast->image->original_url);
    $channel->addChild('language', $podcast->language_code);

    if (!empty($podcast->payment_pointer)) {
        $channel->addChild(
            'monetization',
            $podcast->payment_pointer,
            $podcast_namespace
        );
    }
    $channel
        ->addChild(
            'locked',
+6 −0
Original line number Diff line number Diff line
@@ -61,6 +61,12 @@ return [
        'publisher_hint' =>
            'The group responsible for creating the show. Often refers to the parent company or network of a podcast. This field is sometimes labeled as ’Author’.',
        'copyright' => 'Copyright',
        'monetization_section_title' => 'Monetization',
        'monetization_section_subtitle' =>
            'Earn money thanks to your audience.',
        'payment_pointer' => 'Payment Pointer for Web Monetization',
        'payment_pointer_hint' =>
            'This is your where you will receive money thanks to Web Monetization',
        'status_section_title' => 'Status',
        'status_section_subtitle' => 'Dead or alive?',
        'block' => 'Podcast should be hidden from all platforms',
Loading