Downloading files, calculating video size.
This commit is contained in:
21
app/Console/Commands/SyncFiles.php
Normal file
21
app/Console/Commands/SyncFiles.php
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user