Reading file size

This commit is contained in:
Krzysztof Płaczek committed 2022-12-05 19:39:12 +01:00
1 parent 55c104629f
commit b992d05312
5 files changed
+47 -7

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
<?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;
}
}