feat: add WebSub module for pushing feed updates to open hubs

This commit is contained in:
Yassine Doghri 2022-03-15 16:47:35 +00:00
commit 10d3f73786
17 changed files with 244 additions and 3 deletions

View file

@ -280,6 +280,9 @@ class EpisodeController extends BaseController
$this->episode->setAudio($this->request->getFile('audio_file'));
$this->episode->setCover($this->request->getFile('cover'));
// republish on websub hubs upon edit
$this->episode->is_published_on_hubs = false;
$transcriptChoice = $this->request->getPost('transcript-choice');
if ($transcriptChoice === 'upload-file') {
$transcriptFile = $this->request->getFile('transcript_file');
@ -725,6 +728,11 @@ class EpisodeController extends BaseController
(new PostModel())->removePost($post);
}
// set podcast is_published_on_hubs to false to trigger websub push
(new PodcastModel())->update($this->episode->podcast->id, [
'is_published_on_hubs' => false,
]);
$episodeModel = new EpisodeModel();
if ($this->episode->published_at !== null) {
// if episode is published, set episode published_at to null to unpublish before deletion