feat(fe smart block): added save content method
This commit is contained in:
parent
f357826b95
commit
a17ccd65f0
1 changed files with 23 additions and 0 deletions
|
@ -6,6 +6,7 @@ use App\Filters\FileFilters;
|
||||||
use App\Helpers\LengthFormatter;
|
use App\Helpers\LengthFormatter;
|
||||||
use App\Models\File;
|
use App\Models\File;
|
||||||
use App\Models\SmartBlock;
|
use App\Models\SmartBlock;
|
||||||
|
use App\Models\SmartBlockContent;
|
||||||
use App\Models\SmartBlockCriteria;
|
use App\Models\SmartBlockCriteria;
|
||||||
use DateInterval;
|
use DateInterval;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
|
@ -168,4 +169,26 @@ class SmartBlockController extends Controller
|
||||||
return $list->toJson();
|
return $list->toJson();
|
||||||
//ToDo: add limit from instance length
|
//ToDo: add limit from instance length
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save preview Smart Block Content
|
||||||
|
* ToDo: understand when we need to use it
|
||||||
|
* @param File $file
|
||||||
|
* @param int $block_id
|
||||||
|
* @param int $position
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function saveContent(File $file, int $block_id, int $position = 0) {
|
||||||
|
SmartBlockContent::create([
|
||||||
|
'block_id' => $block_id,
|
||||||
|
'file_id' => $file->id,
|
||||||
|
'position' => $position,
|
||||||
|
'trackoffset' => 0, //ToDo: understand this field
|
||||||
|
'cliplength' => $file->length,
|
||||||
|
'cuein' => $file->cuein,
|
||||||
|
'cueout' => $file->cueout,
|
||||||
|
'fadein' => '00:00:00', //ToDo: add fadein/fadeout
|
||||||
|
'fadeout' => '00:00:00',
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue