Loading app/Config/Events.php +22 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,8 @@ Events::on('on_note_add', function (Note $note): void { // same for other events below cache() ->deleteMatching("page_podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("podcast#{$note->actor->podcast->id}*"); }); Events::on('on_note_remove', function (Note $note): void { Loading @@ -108,6 +110,8 @@ Events::on('on_note_remove', function (Note $note): void { cache() ->deleteMatching("page_podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("page_note#{$note->id}*"); }); Loading @@ -125,6 +129,8 @@ Events::on('on_note_reblog', function (Actor $actor, Note $note): void { cache() ->deleteMatching("page_podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("page_note#{$note->id}*"); Loading @@ -147,6 +153,8 @@ Events::on('on_note_undo_reblog', function (Note $reblogNote): void { cache() ->deleteMatching("page_podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("page_note#{$note->id}*"); Loading @@ -169,6 +177,8 @@ Events::on('on_reply_remove', function (Note $reply): void { cache() ->deleteMatching("page_podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("page_note#{$note->id}*"); }); Loading @@ -182,6 +192,8 @@ Events::on('on_note_favourite', function (Actor $actor, Note $note): void { cache() ->deleteMatching("page_podcast#{$actor->podcast->id}*"); cache() ->deleteMatching("podcast#{$actor->podcast->id}*"); cache() ->deleteMatching("page_note#{$note->id}*"); Loading @@ -199,6 +211,8 @@ Events::on('on_note_undo_favourite', function (Actor $actor, Note $note): void { cache() ->deleteMatching("page_podcast#{$actor->podcast->id}*"); cache() ->deleteMatching("podcast#{$actor->podcast->id}*"); cache() ->deleteMatching("page_note#{$note->id}*"); Loading @@ -209,24 +223,32 @@ Events::on('on_note_undo_favourite', function (Actor $actor, Note $note): void { Events::on('on_block_actor', function (int $actorId): void { cache()->deleteMatching('page_podcast*'); cache() ->deleteMatching('podcast*'); cache() ->deleteMatching('page_note*'); }); Events::on('on_unblock_actor', function (int $actorId): void { cache()->deleteMatching('page_podcast*'); cache() ->deleteMatching('podcast*'); cache() ->deleteMatching('page_note*'); }); Events::on('on_block_domain', function (string $domainName): void { cache()->deleteMatching('page_podcast*'); cache() ->deleteMatching('podcast*'); cache() ->deleteMatching('page_note*'); }); Events::on('on_unblock_domain', function (string $domainName): void { cache()->deleteMatching('page_podcast*'); cache() ->deleteMatching('podcast*'); cache() ->deleteMatching('page_note*'); }); app/Controllers/Admin/EpisodeController.php +11 −4 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ namespace App\Controllers\Admin; use App\Entities\Episode; use App\Entities\Image; use App\Entities\Location; use App\Entities\Note; use App\Entities\Podcast; Loading Loading @@ -118,6 +119,12 @@ class EpisodeController extends BaseController ->with('errors', $this->validator->getErrors()); } $image = null; $imageFile = $this->request->getFile('image'); if ($imageFile !== null && $imageFile->isValid()) { $image = new Image($imageFile); } $newEpisode = new Episode([ 'podcast_id' => $this->podcast->id, 'title' => $this->request->getPost('title'), Loading @@ -125,7 +132,7 @@ class EpisodeController extends BaseController 'guid' => '', 'audio_file' => $this->request->getFile('audio_file'), 'description_markdown' => $this->request->getPost('description'), 'image' => $this->request->getFile('image'), 'image' => $image, 'location' => new Location($this->request->getPost('location_name'),), 'transcript' => $this->request->getFile('transcript'), 'chapters' => $this->request->getFile('chapters'), Loading Loading @@ -253,9 +260,9 @@ class EpisodeController extends BaseController $this->episode->audio_file = $audioFile; } $image = $this->request->getFile('image'); if ($image !== null && $image->isValid()) { $this->episode->image = $image; $imageFile = $this->request->getFile('image'); if ($imageFile !== null && $imageFile->isValid()) { $this->episode->image = new Image($imageFile); } $transcriptChoice = $this->request->getPost('transcript-choice'); Loading app/Controllers/Admin/EpisodePersonController.php +3 −3 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ class EpisodePersonController extends BaseController public function attemptAdd(): RedirectResponse { $rules = [ 'person' => 'required', 'persons' => 'required', ]; if (! $this->validate($rules)) { Loading @@ -79,8 +79,8 @@ class EpisodePersonController extends BaseController (new PersonModel())->addEpisodePersons( $this->podcast->id, $this->episode->id, $this->request->getPost('person'), $this->request->getPost('person_group_role'), $this->request->getPost('persons'), $this->request->getPost('roles') ?? [], ); return redirect()->back(); Loading app/Controllers/Admin/PodcastController.php +2 −2 Original line number Diff line number Diff line Loading @@ -230,7 +230,7 @@ class PodcastController extends BaseController // set Podcast categories (new CategoryModel())->setPodcastCategories( (int) $newPodcastId, $this->request->getPost('other_categories'), $this->request->getPost('other_categories') ?? [], ); // set interact as the newly created podcast actor Loading Loading @@ -320,7 +320,7 @@ class PodcastController extends BaseController // set Podcast categories (new CategoryModel())->setPodcastCategories( $this->podcast->id, $this->request->getPost('other_categories'), $this->request->getPost('other_categories') ?? [], ); $db->transComplete(); Loading app/Controllers/PodcastController.php +8 −1 Original line number Diff line number Diff line Loading @@ -67,8 +67,15 @@ class PodcastController extends BaseController helper('form'); return view('podcast/activity_authenticated', $data); } $secondsToNextUnpublishedEpisode = (new EpisodeModel())->getSecondsToNextUnpublishedEpisode( $this->podcast->id, ); return view('podcast/activity', $data, [ 'cache' => DECADE, 'cache' => $secondsToNextUnpublishedEpisode ? $secondsToNextUnpublishedEpisode : DECADE, 'cache_name' => $cacheName, ]); } Loading Loading
app/Config/Events.php +22 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,8 @@ Events::on('on_note_add', function (Note $note): void { // same for other events below cache() ->deleteMatching("page_podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("podcast#{$note->actor->podcast->id}*"); }); Events::on('on_note_remove', function (Note $note): void { Loading @@ -108,6 +110,8 @@ Events::on('on_note_remove', function (Note $note): void { cache() ->deleteMatching("page_podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("page_note#{$note->id}*"); }); Loading @@ -125,6 +129,8 @@ Events::on('on_note_reblog', function (Actor $actor, Note $note): void { cache() ->deleteMatching("page_podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("page_note#{$note->id}*"); Loading @@ -147,6 +153,8 @@ Events::on('on_note_undo_reblog', function (Note $reblogNote): void { cache() ->deleteMatching("page_podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("page_note#{$note->id}*"); Loading @@ -169,6 +177,8 @@ Events::on('on_reply_remove', function (Note $reply): void { cache() ->deleteMatching("page_podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("podcast#{$note->actor->podcast->id}*"); cache() ->deleteMatching("page_note#{$note->id}*"); }); Loading @@ -182,6 +192,8 @@ Events::on('on_note_favourite', function (Actor $actor, Note $note): void { cache() ->deleteMatching("page_podcast#{$actor->podcast->id}*"); cache() ->deleteMatching("podcast#{$actor->podcast->id}*"); cache() ->deleteMatching("page_note#{$note->id}*"); Loading @@ -199,6 +211,8 @@ Events::on('on_note_undo_favourite', function (Actor $actor, Note $note): void { cache() ->deleteMatching("page_podcast#{$actor->podcast->id}*"); cache() ->deleteMatching("podcast#{$actor->podcast->id}*"); cache() ->deleteMatching("page_note#{$note->id}*"); Loading @@ -209,24 +223,32 @@ Events::on('on_note_undo_favourite', function (Actor $actor, Note $note): void { Events::on('on_block_actor', function (int $actorId): void { cache()->deleteMatching('page_podcast*'); cache() ->deleteMatching('podcast*'); cache() ->deleteMatching('page_note*'); }); Events::on('on_unblock_actor', function (int $actorId): void { cache()->deleteMatching('page_podcast*'); cache() ->deleteMatching('podcast*'); cache() ->deleteMatching('page_note*'); }); Events::on('on_block_domain', function (string $domainName): void { cache()->deleteMatching('page_podcast*'); cache() ->deleteMatching('podcast*'); cache() ->deleteMatching('page_note*'); }); Events::on('on_unblock_domain', function (string $domainName): void { cache()->deleteMatching('page_podcast*'); cache() ->deleteMatching('podcast*'); cache() ->deleteMatching('page_note*'); });
app/Controllers/Admin/EpisodeController.php +11 −4 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ namespace App\Controllers\Admin; use App\Entities\Episode; use App\Entities\Image; use App\Entities\Location; use App\Entities\Note; use App\Entities\Podcast; Loading Loading @@ -118,6 +119,12 @@ class EpisodeController extends BaseController ->with('errors', $this->validator->getErrors()); } $image = null; $imageFile = $this->request->getFile('image'); if ($imageFile !== null && $imageFile->isValid()) { $image = new Image($imageFile); } $newEpisode = new Episode([ 'podcast_id' => $this->podcast->id, 'title' => $this->request->getPost('title'), Loading @@ -125,7 +132,7 @@ class EpisodeController extends BaseController 'guid' => '', 'audio_file' => $this->request->getFile('audio_file'), 'description_markdown' => $this->request->getPost('description'), 'image' => $this->request->getFile('image'), 'image' => $image, 'location' => new Location($this->request->getPost('location_name'),), 'transcript' => $this->request->getFile('transcript'), 'chapters' => $this->request->getFile('chapters'), Loading Loading @@ -253,9 +260,9 @@ class EpisodeController extends BaseController $this->episode->audio_file = $audioFile; } $image = $this->request->getFile('image'); if ($image !== null && $image->isValid()) { $this->episode->image = $image; $imageFile = $this->request->getFile('image'); if ($imageFile !== null && $imageFile->isValid()) { $this->episode->image = new Image($imageFile); } $transcriptChoice = $this->request->getPost('transcript-choice'); Loading
app/Controllers/Admin/EpisodePersonController.php +3 −3 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ class EpisodePersonController extends BaseController public function attemptAdd(): RedirectResponse { $rules = [ 'person' => 'required', 'persons' => 'required', ]; if (! $this->validate($rules)) { Loading @@ -79,8 +79,8 @@ class EpisodePersonController extends BaseController (new PersonModel())->addEpisodePersons( $this->podcast->id, $this->episode->id, $this->request->getPost('person'), $this->request->getPost('person_group_role'), $this->request->getPost('persons'), $this->request->getPost('roles') ?? [], ); return redirect()->back(); Loading
app/Controllers/Admin/PodcastController.php +2 −2 Original line number Diff line number Diff line Loading @@ -230,7 +230,7 @@ class PodcastController extends BaseController // set Podcast categories (new CategoryModel())->setPodcastCategories( (int) $newPodcastId, $this->request->getPost('other_categories'), $this->request->getPost('other_categories') ?? [], ); // set interact as the newly created podcast actor Loading Loading @@ -320,7 +320,7 @@ class PodcastController extends BaseController // set Podcast categories (new CategoryModel())->setPodcastCategories( $this->podcast->id, $this->request->getPost('other_categories'), $this->request->getPost('other_categories') ?? [], ); $db->transComplete(); Loading
app/Controllers/PodcastController.php +8 −1 Original line number Diff line number Diff line Loading @@ -67,8 +67,15 @@ class PodcastController extends BaseController helper('form'); return view('podcast/activity_authenticated', $data); } $secondsToNextUnpublishedEpisode = (new EpisodeModel())->getSecondsToNextUnpublishedEpisode( $this->podcast->id, ); return view('podcast/activity', $data, [ 'cache' => DECADE, 'cache' => $secondsToNextUnpublishedEpisode ? $secondsToNextUnpublishedEpisode : DECADE, 'cache_name' => $cacheName, ]); } Loading