Send new artwork uploads through a trust-based review policy.

Require review for untrusted accounts, add admin artwork review APIs, and keep queued or auto-trusted publishes from counting as established history.
This commit is contained in:
2026-09-20 14:49:06 +02:00
parent 31c87e4977
commit 0f52803b05
14 changed files with 1175 additions and 70 deletions
+20 -2
View File
@@ -9,6 +9,7 @@ use App\Jobs\AutoTagArtworkJob;
use App\Jobs\DetectArtworkMaturityJob;
use App\Jobs\GenerateArtworkEmbeddingJob;
use App\Models\Artwork;
use App\Services\Moderation\ArtworkUploadPolicy;
use App\Models\UploadBatch;
use App\Models\UploadBatchItem;
use App\Models\User;
@@ -392,8 +393,24 @@ final class UploadQueueService
}
$artwork = $item->artwork;
$policy = app(ArtworkUploadPolicy::class)->assess($item->user ?? $artwork->user, $artwork);
if ($policy['requires_review']) {
$artwork->forceFill([
'is_public' => false,
'is_approved' => false,
'artwork_status' => 'review',
'approval_source' => null,
'moderation_note' => implode(', ', $policy['reasons']),
])->saveQuietly();
$item->forceFill([
'status' => UploadBatchItem::STATUS_NEEDS_REVIEW,
'is_ready_to_publish' => false,
])->save();
return;
}
$artwork->forceFill([
'is_approved' => true,
'approval_source' => 'trusted_auto',
'visibility' => $artwork->visibility ?: Artwork::VISIBILITY_PUBLIC,
])->saveQuietly();
@@ -428,7 +445,8 @@ final class UploadQueueService
]);
}
$item->artwork->categories()->sync([$categoryId]);
app(\App\Services\Artworks\ArtworkCategoryService::class)
->sync($item->artwork, $categoryId, [], 'user');
$this->refreshItem((int) $item->id);
}
@@ -790,4 +808,4 @@ final class UploadQueueService
return $normalized === '' ? null : Str::limit($normalized, 65535, '');
}
}
}