processAndPublish( $this->sessionId, $this->hash, $this->artworkId, $this->originalFileName, $this->archiveSessionId, $this->archiveHash, $this->archiveOriginalFileName, $this->additionalScreenshotSessions ); if ($this->batchItemId) { $queue->markItemMediaProcessed($this->batchItemId); } // Auto-tagging is async and must never block publish. AutoTagArtworkJob::dispatch($this->artworkId, $this->hash)->afterCommit(); DetectArtworkMaturityJob::dispatch($this->artworkId, $this->hash)->afterCommit(); GenerateArtworkEmbeddingJob::dispatch($this->artworkId, $this->hash)->afterCommit(); AnalyzeArtworkAiAssistJob::dispatch($this->artworkId)->afterCommit(); } public function failed(\Throwable $exception): void { if (! $this->batchItemId) { return; } app(UploadQueueService::class)->markItemFailed( $this->batchItemId, 'derivatives_failed', $exception->getMessage() ); } }