Files
cv4/app/Jobs/RemotePrefetch.php
2025-01-11 13:07:32 -05:00

52 lines
1.3 KiB
PHP

<?php
namespace App\Jobs;
use App\Remote\CopyManga;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Support\Facades\Log;
class RemotePrefetch implements ShouldQueue
{
use Queueable;
/**
* Create a new job instance.
*/
public function __construct(public string $action, public array $parameters = [])
{
//
}
/**
* Execute the job.
*/
public function handle(): void
{
$copyManga = new CopyManga();
switch ($this->action) {
case 'chapter':
Log::info("JOB RemotePrefetch START, action '{$this->action}', Pathword: {$this->parameters['pathword']}, UUID: {$this->parameters['uuid']}");
$copyManga->chapter($this->parameters['pathword'], $this->parameters['uuid']);
Log::info("JOB RemotePrefetch END, action '{$this->action}'");
break;
case 'chapters':
// TODO:
break;
case 'index':
// TODO
break;
case 'tags':
// TODO
break;
default:
Log::info("JOB RemotePrefetch Unknown action '{$this->action}'");
break;
}
}
}