Video size is handled by the queue job.

This commit is contained in:
Krzysztof Płaczek
2022-09-16 10:52:50 +02:00
parent b158ec6b5d
commit c5f4a8ed2d
5 changed files with 113 additions and 5 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace App\Jobs;
use App\Http\SymfonyCastDl\HtmlParser;
use App\Http\SymfonyCastDl\SymfonyCastDlService;
use App\Models\Chapter;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
class GetVideoFileSize implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function __construct(private int $chapterId)
{
}
public function handle(HtmlParser $htmlParser)
{
// $this->
// $this->videoSize($this->chapter);
// $this->chapter->save();
$service = new SymfonyCastDlService($htmlParser);
$service->videoSize(Chapter::find($this->chapterId));
// dd($this->chapterId);
}
}