Files
symfonycast.local/app/Console/Commands/UpdateVideoSize.php
Krzysztof Płaczek b992d05312 Reading file size
2022-12-05 19:39:12 +01:00

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;
}
}