mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-14 18:02:01 -04:00
55 lines
1.6 KiB
PHP
55 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace Modules\StudioPlus\Jobs;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Queue\Events\JobFailed;
|
|
use Illuminate\Support\Facades\Queue;
|
|
use Modules\StudioPlus\Entities\StudioMetaBatchJob;
|
|
use Modules\StudioPlus\Entities\StudioPlusVideo;
|
|
use Modules\StudioPlus\Entities\WatermarkingJob;
|
|
use Modules\StudioPlus\Events\UpdateJobStatusEvent;
|
|
use Modules\StudioPlus\Services\VideoProcessingService;
|
|
use Throwable;
|
|
|
|
class UpdateVideoMeta implements ShouldQueue, ShouldBeUnique
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
public $timeout = 3000;
|
|
public $failOnTimeout = false;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->connection = 'studio-patch';
|
|
$this->queue = 'studio-patch';
|
|
}
|
|
|
|
public function handle()
|
|
{
|
|
$job = StudioMetaBatchJob::where('status', 'pending')->first();
|
|
|
|
if ($job) {
|
|
$job->status = 'processing';
|
|
$job->update();
|
|
|
|
$videos = StudioPlusVideo::whereBetween('id', [$job->sid, $job->eid])->get();
|
|
|
|
foreach ($videos as $video) {
|
|
$video->is_old = $video->old;
|
|
$video->in_youtube = $video->youtube;
|
|
$video->in_ott = $video->ott;
|
|
$video->update();
|
|
}
|
|
|
|
$job->status = 'processed';
|
|
$job->update();
|
|
}
|
|
}
|
|
}
|