Implement creator studio and upload updates

This commit is contained in:
2026-04-04 10:12:02 +02:00
parent 1da7d3bf88
commit 0b216b7ecd
15107 changed files with 31206 additions and 626514 deletions

View File

@@ -17,13 +17,18 @@ class ThumbnailService
return rtrim((string) config('cdn.files_url', 'https://files.skinbase.org'), '/');
}
protected static function artworkPrefix(): string
{
return trim((string) config('uploads.object_storage.prefix', 'artworks'), '/');
}
/**
* Canonical size keys: xs · sm · md · lg · xl (+ legacy thumb/sq support).
*/
protected const VALID_SIZES = ['xs', 'sm', 'md', 'lg', 'xl', 'thumb', 'sq'];
/** Size aliases for backwards compatibility with old callers. */
protected const SIZE_ALIAS = [];
protected const SIZE_ALIAS = ['thumb' => 'sm'];
protected const THUMB_SIZES = [
'xs' => ['height' => 160, 'quality' => 74, 'dir' => 'xs'],
@@ -33,7 +38,7 @@ class ThumbnailService
'lg' => ['height' => 1920, 'quality' => 85, 'dir' => 'lg'],
'xl' => ['height' => 2560, 'quality' => 90, 'dir' => 'xl'],
// Legacy compatibility for older paths still expecting /thumb/.
'thumb' => ['height' => 320, 'quality' => 78, 'dir' => 'thumb'],
'thumb' => ['height' => 320, 'quality' => 78, 'dir' => 'sm'],
];
/**
@@ -94,7 +99,7 @@ class ThumbnailService
$h = $hash;
$h1 = substr($h, 0, 2);
$h2 = substr($h, 2, 2);
return sprintf('%s/%s/%s/%s/%s.%s', self::cdnHost(), $dir, $h1, $h2, $h, $ext);
return sprintf('%s/%s/%s/%s/%s.%s', self::cdnHost(), self::artworkPrefix() . '/' . $dir, $h1, $h2, $h, $ext);
}
/**