This commit is contained in:
2026-03-20 21:17:26 +01:00
parent 1a62fcb81d
commit 29c3ff8572
229 changed files with 13147 additions and 2577 deletions

View File

@@ -264,35 +264,6 @@ class BrowseGalleryController extends \App\Http\Controllers\Controller
);
}
public function legacyCategory(Request $request, ?string $group = null, ?string $slug = null, ?string $id = null)
{
if ($id !== null && ctype_digit((string) $id)) {
$category = Category::with('contentType')->find((int) $id);
if (! $category || ! $category->contentType) {
abort(404);
}
return redirect($category->url, 301);
}
$contentSlug = strtolower((string) $group);
if (! in_array($contentSlug, self::CONTENT_TYPE_SLUGS, true)) {
abort(404);
}
$target = '/' . $contentSlug;
$normalizedSlug = trim((string) $slug, '/');
if ($normalizedSlug !== '') {
$target .= '/' . strtolower($normalizedSlug);
}
if ($request->query()) {
$target .= '?' . http_build_query($request->query());
}
return redirect($target, 301);
}
private function presentArtwork(Artwork $artwork): object
{
$primaryCategory = $artwork->categories->sortBy('sort_order')->first();