Implement creator studio and upload updates
This commit is contained in:
@@ -25,13 +25,26 @@ final class GenerateDerivativesJob implements ShouldQueue
|
||||
private readonly string $sessionId,
|
||||
private readonly string $hash,
|
||||
private readonly int $artworkId,
|
||||
private readonly ?string $originalFileName = null
|
||||
private readonly ?string $originalFileName = null,
|
||||
private readonly ?string $archiveSessionId = null,
|
||||
private readonly ?string $archiveHash = null,
|
||||
private readonly ?string $archiveOriginalFileName = null,
|
||||
private readonly array $additionalScreenshotSessions = []
|
||||
) {
|
||||
}
|
||||
|
||||
public function handle(UploadPipelineService $pipeline): void
|
||||
{
|
||||
$pipeline->processAndPublish($this->sessionId, $this->hash, $this->artworkId, $this->originalFileName);
|
||||
$pipeline->processAndPublish(
|
||||
$this->sessionId,
|
||||
$this->hash,
|
||||
$this->artworkId,
|
||||
$this->originalFileName,
|
||||
$this->archiveSessionId,
|
||||
$this->archiveHash,
|
||||
$this->archiveOriginalFileName,
|
||||
$this->additionalScreenshotSessions
|
||||
);
|
||||
|
||||
// Auto-tagging is async and must never block publish.
|
||||
AutoTagArtworkJob::dispatch($this->artworkId, $this->hash)->afterCommit();
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace App\Jobs\NovaCards;
|
||||
|
||||
use App\Models\NovaCard;
|
||||
use App\Services\NovaCards\NovaCardPublishModerationService;
|
||||
use App\Services\NovaCards\NovaCardPlaywrightRenderService;
|
||||
use App\Services\NovaCards\NovaCardRenderService;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
@@ -22,14 +23,25 @@ class RenderNovaCardPreviewJob implements ShouldQueue
|
||||
) {
|
||||
}
|
||||
|
||||
public function handle(NovaCardRenderService $renderService, NovaCardPublishModerationService $moderation): void
|
||||
public function handle(NovaCardRenderService $renderService, NovaCardPlaywrightRenderService $playwrightService, NovaCardPublishModerationService $moderation): void
|
||||
{
|
||||
$card = NovaCard::query()->with(['backgroundImage'])->find($this->cardId);
|
||||
$card = NovaCard::query()->with(['backgroundImage', 'user'])->find($this->cardId);
|
||||
if (! $card) {
|
||||
return;
|
||||
}
|
||||
|
||||
$renderService->render($card);
|
||||
// Try the CSS/Playwright renderer first (pixel-perfect match with the editor).
|
||||
// Falls back to the GD renderer if Playwright is disabled or encounters an error.
|
||||
if ($playwrightService->isAvailable()) {
|
||||
try {
|
||||
$playwrightService->render($card);
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
$renderService->render($card->fresh()->load(['backgroundImage']));
|
||||
}
|
||||
} else {
|
||||
$renderService->render($card);
|
||||
}
|
||||
|
||||
$evaluation = $moderation->evaluate($card->fresh()->loadMissing(['originalCard.user', 'rootCard.user']));
|
||||
|
||||
|
||||
30
app/Jobs/Sitemaps/BuildSitemapReleaseJob.php
Normal file
30
app/Jobs/Sitemaps/BuildSitemapReleaseJob.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Jobs\Sitemaps;
|
||||
|
||||
use App\Services\Sitemaps\SitemapPublishService;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
final class BuildSitemapReleaseJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable;
|
||||
use InteractsWithQueue;
|
||||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
public function __construct(private readonly ?array $families = null, private readonly ?string $releaseId = null)
|
||||
{
|
||||
$this->onQueue('default');
|
||||
}
|
||||
|
||||
public function handle(SitemapPublishService $publish): void
|
||||
{
|
||||
$publish->buildRelease($this->families, $this->releaseId);
|
||||
}
|
||||
}
|
||||
25
app/Jobs/Sitemaps/CleanupSitemapReleasesJob.php
Normal file
25
app/Jobs/Sitemaps/CleanupSitemapReleasesJob.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Jobs\Sitemaps;
|
||||
|
||||
use App\Services\Sitemaps\SitemapReleaseCleanupService;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
final class CleanupSitemapReleasesJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable;
|
||||
use InteractsWithQueue;
|
||||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
public function handle(SitemapReleaseCleanupService $cleanup): void
|
||||
{
|
||||
$cleanup->cleanup();
|
||||
}
|
||||
}
|
||||
30
app/Jobs/Sitemaps/PublishSitemapReleaseJob.php
Normal file
30
app/Jobs/Sitemaps/PublishSitemapReleaseJob.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Jobs\Sitemaps;
|
||||
|
||||
use App\Services\Sitemaps\SitemapPublishService;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
final class PublishSitemapReleaseJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable;
|
||||
use InteractsWithQueue;
|
||||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
public function __construct(private readonly ?string $releaseId = null)
|
||||
{
|
||||
$this->onQueue('default');
|
||||
}
|
||||
|
||||
public function handle(SitemapPublishService $publish): void
|
||||
{
|
||||
$publish->publish($this->releaseId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user