chore(clips): clear video clip and soundbite cache on delete

This commit is contained in:
Yassine Doghri 2022-01-10 16:52:12 +00:00
commit 241366130e
3 changed files with 33 additions and 33 deletions

View file

@ -150,9 +150,12 @@ class SoundbiteController extends BaseController
if ($soundbite->media === null) {
// delete Clip directly
(new ClipModel())->delete($soundbite->id);
(new ClipModel())->deleteSoundbite($this->podcast->id, $this->episode->id, $soundbite->id);
} else {
(new ClipModel())->clearSoundbiteCache($this->podcast->id, $this->episode->id, $soundbite->id);
$mediaModel = new MediaModel();
// delete the soundbite file, the clip will be deleted on cascade
if (! $mediaModel->deleteMedia($soundbite->media)) {
return redirect()
->back()