Downloading files, calculating video size.

This commit is contained in:
Krzysztof Płaczek
2022-11-17 11:38:20 +01:00
parent 2c62880282
commit 55c104629f
9 changed files with 77 additions and 23 deletions

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Console\Commands;
use App\Jobs\DownloadVideoFile;
use App\Models\Chapter;
use Illuminate\Console\Command;
class SyncFiles extends Command
{
protected $signature = 'symfonycast:sync';
protected $description = 'Downloads files locally for chapters marked as sync offline';
public function handle()
{
$chapters = Chapter::where('sync_offline', 1)->get();
$chapters->each(fn($chapter) => DownloadVideoFile::dispatch($chapter->id));
return self::SUCCESS;
}
}