mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-13 11:37:46 +02:00
refactor: replace ui function components with class components + fix
soundbites js
This commit is contained in:
parent
5413d09737
commit
746b518789
60 changed files with 542 additions and 1570 deletions
|
|
@ -722,6 +722,7 @@ class EpisodeController extends BaseController
|
|||
"soundbites.{$soundbite_id}.duration" => 'required|decimal|greater_than_equal_to[0]',
|
||||
];
|
||||
}
|
||||
|
||||
if (! $this->validate($rules)) {
|
||||
return redirect()
|
||||
->back()
|
||||
|
|
@ -730,34 +731,33 @@ class EpisodeController extends BaseController
|
|||
}
|
||||
|
||||
foreach ($soundbites as $soundbite_id => $soundbite) {
|
||||
if ((int) $soundbite['start_time'] < (int) $soundbite['duration']) {
|
||||
$data = [
|
||||
'podcast_id' => $this->podcast->id,
|
||||
'episode_id' => $this->episode->id,
|
||||
'start_time' => (float) $soundbite['start_time'],
|
||||
'duration' => (float) $soundbite['duration'],
|
||||
'label' => $soundbite['label'],
|
||||
'updated_by' => user_id(),
|
||||
$data = [
|
||||
'podcast_id' => $this->podcast->id,
|
||||
'episode_id' => $this->episode->id,
|
||||
'start_time' => (float) $soundbite['start_time'],
|
||||
'duration' => (float) $soundbite['duration'],
|
||||
'label' => $soundbite['label'],
|
||||
'updated_by' => user_id(),
|
||||
];
|
||||
if ($soundbite_id === 0) {
|
||||
$data += [
|
||||
'created_by' => user_id(),
|
||||
];
|
||||
if ($soundbite_id === 0) {
|
||||
$data += [
|
||||
'created_by' => user_id(),
|
||||
];
|
||||
} else {
|
||||
$data += [
|
||||
'id' => $soundbite_id,
|
||||
];
|
||||
}
|
||||
} else {
|
||||
$data += [
|
||||
'id' => $soundbite_id,
|
||||
];
|
||||
}
|
||||
|
||||
$soundbiteModel = new SoundbiteModel();
|
||||
if (! $soundbiteModel->save($data)) {
|
||||
return redirect()
|
||||
->back()
|
||||
->withInput()
|
||||
->with('errors', $soundbiteModel->errors());
|
||||
}
|
||||
$soundbiteModel = new SoundbiteModel();
|
||||
if (! $soundbiteModel->save($data)) {
|
||||
return redirect()
|
||||
->back()
|
||||
->withInput()
|
||||
->with('errors', $soundbiteModel->errors());
|
||||
}
|
||||
}
|
||||
|
||||
return redirect()->route('soundbites-edit', [$this->podcast->id, $this->episode->id]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue