feat(media): save audio, images, transcripts and chapters to media for episode and persons

This commit is contained in:
Yassine Doghri 2021-12-20 17:12:12 +00:00
commit 58e2a00a87
22 changed files with 144 additions and 129 deletions

View file

@ -192,6 +192,9 @@ class PodcastController extends BaseController
$partnerImageUrl = null;
}
$db = db_connect();
$db->transStart();
$newPodcast = new Podcast([
'title' => $this->request->getPost('title'),
'handle' => $this->request->getPost('handle'),
@ -226,9 +229,6 @@ class PodcastController extends BaseController
'updated_by' => user_id(),
]);
$db = db_connect();
$db->transStart();
$podcastModel = new PodcastModel();
if (! ($newPodcastId = $podcastModel->insert($newPodcast, true))) {
$db->transRollback();
@ -363,10 +363,8 @@ class PodcastController extends BaseController
return redirect()->back();
}
$this->podcast->banner->deleteFile();
$mediaModel = new MediaModel();
if (! $mediaModel->deleteMedia((int) $this->podcast->banner_id)) {
if (! $mediaModel->deleteMedia($this->podcast->banner)) {
return redirect()
->back()
->withInput()