mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-11 10:46:43 +02:00
fix(video-clips): check if created video exists before recreating it and failing
update seed scripts to prevent sql error when reloading install page
This commit is contained in:
parent
2385b1a292
commit
dff1208725
8 changed files with 70 additions and 23 deletions
|
|
@ -176,11 +176,20 @@ class VideoClipsController extends BaseController
|
|||
'updated_by' => user_id(),
|
||||
]);
|
||||
|
||||
// Check if video clip exists before inserting a new line
|
||||
if ((new ClipModel())->doesVideoClipExist($videoClip)) {
|
||||
// video clip already exists
|
||||
return redirect()
|
||||
->back()
|
||||
->withInput()
|
||||
->with('error', lang('VideoClip.messages.alreadyExistingError'));
|
||||
}
|
||||
|
||||
(new ClipModel())->insert($videoClip);
|
||||
|
||||
return redirect()->route('video-clips-list', [$this->podcast->id, $this->episode->id])->with(
|
||||
'message',
|
||||
lang('Settings.images.regenerationSuccess')
|
||||
lang('VideoClip.messages.addToQueueSuccess')
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue