23 lines
540 B
PHP
23 lines
540 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Jobs\DownloadVideoFile;
|
|
use App\Jobs\GetVideoFileSize;
|
|
use App\Models\Chapter;
|
|
use Illuminate\Console\Command;
|
|
|
|
class UpdateVideoSize extends Command
|
|
{
|
|
protected $signature = 'symfonycast:video_size';
|
|
|
|
protected $description = 'Updates information about video size';
|
|
|
|
public function handle()
|
|
{
|
|
$chapters = Chapter::where('video_size', 0)->get();
|
|
$chapters->each(fn($chapter) => GetVideoFileSize::dispatch($chapter->id));
|
|
return self::SUCCESS;
|
|
}
|
|
}
|