Implement creator studio and upload updates
This commit is contained in:
@@ -8,6 +8,8 @@ use Illuminate\Support\Facades\DB;
|
||||
|
||||
final class ArtworkFileRepository
|
||||
{
|
||||
private const SCREENSHOT_VARIANT_PREFIX = 'shot';
|
||||
|
||||
public function upsert(int $artworkId, string $variant, string $path, string $mime, int $size): void
|
||||
{
|
||||
DB::table('artwork_files')->updateOrInsert(
|
||||
@@ -15,4 +17,20 @@ final class ArtworkFileRepository
|
||||
['path' => $path, 'mime' => $mime, 'size' => $size]
|
||||
);
|
||||
}
|
||||
|
||||
public function deleteVariant(int $artworkId, string $variant): void
|
||||
{
|
||||
DB::table('artwork_files')
|
||||
->where('artwork_id', $artworkId)
|
||||
->where('variant', $variant)
|
||||
->delete();
|
||||
}
|
||||
|
||||
public function deleteScreenshotVariants(int $artworkId): void
|
||||
{
|
||||
DB::table('artwork_files')
|
||||
->where('artwork_id', $artworkId)
|
||||
->where('variant', 'like', self::SCREENSHOT_VARIANT_PREFIX . '%')
|
||||
->delete();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user