optimizations

This commit is contained in:
2026-03-28 19:15:39 +01:00
parent 0b25d9570a
commit cab4fbd83e
509 changed files with 1016804 additions and 1605 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Uploads\Services;
use App\Models\Artwork;
use App\Models\User;
use App\Uploads\Exceptions\DraftQuotaException;
use Illuminate\Http\UploadedFile;
@@ -79,11 +80,10 @@ final class DraftQuotaService
private function publishedMainHashExists(string $hash): bool
{
return DB::table('upload_files as uf')
->join('uploads as u', 'u.id', '=', 'uf.upload_id')
->where('uf.type', 'main')
->where('uf.hash', $hash)
->where('u.status', 'published')
return Artwork::query()
->where('hash', $hash)
->where('artwork_status', 'published')
->whereNotNull('published_at')
->exists();
}
}