Reading file size
This commit is contained in:
22
app/Console/Commands/UpdateVideoSize.php
Normal file
22
app/Console/Commands/UpdateVideoSize.php
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user