This commit is contained in:
User
2025-01-21 19:57:07 -05:00
parent befc90dd02
commit d9f57e4e86
17 changed files with 206 additions and 230 deletions

View File

@@ -6,11 +6,10 @@ use App\Remote\CopyManga;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Support\Facades\Log;
use romanzipp\QueueMonitor\Traits\IsMonitored;
class RemotePrefetch implements ShouldQueue
{
use IsMonitored, Queueable;
use Queueable;
/**
* Create a new job instance.
@@ -25,17 +24,11 @@ class RemotePrefetch implements ShouldQueue
*/
public function handle(): void
{
$this->queueProgress(0);
$copyManga = new CopyManga();
switch ($this->action) {
case 'chapter':
Log::info("JOB RemotePrefetch START, action '{$this->action}', Pathword: {$this->parameters['pathword']}, UUID: {$this->parameters['uuid']}");
$this->queueData([
'action' => $this->action,
'pathword' => $this->parameters['pathword'],
'uuid' => $this->parameters['uuid']
]);
$copyManga->chapter($this->parameters['pathword'], $this->parameters['uuid']);
@@ -46,13 +39,6 @@ class RemotePrefetch implements ShouldQueue
break;
case 'comics':
Log::info("JOB RemotePrefetch START, action '{$this->action}', Offset: {$this->parameters['offset']}");
$this->queueData([
'action' => $this->action,
'offset' => $this->parameters['offset'],
'limit' => $this->parameters['limit'],
'top' => $this->parameters['top'],
'params' => $this->parameters['params']
]);
$copyManga->comics($this->parameters['offset'], $this->parameters['limit'], $this->parameters['top'], $this->parameters['params']);
@@ -62,7 +48,5 @@ class RemotePrefetch implements ShouldQueue
Log::info("JOB RemotePrefetch Unknown action '{$this->action}'");
break;
}
$this->queueProgress(100);
}
}