Files
laraundfelix/app/Http/Controllers/WebsiteMediaController.php
T
LarsandClaude Sonnet 5.5 be932c113a
CI Feature / test (push) Successful in 2m5s
Deploy Test / test (push) Successful in 1m56s
Deploy Test / deploy (push) Successful in 27s
Zeige die Website-Datei eines Mediums ohne Fassung im Medienmanager an
Ein Film oder Hörstück ohne Inhaltsfassung zeigte nur „Noch keine Inhaltsfassung“; die
hochgeladene Website-Datei war nirgends ansehbar. Die Detailansicht spielt sie jetzt ab
(Reiter Inhalt und Website), über eine Redaktions-Route nur für angemeldete Redakteure,
mit Bereichsabrufen. Die Bereichsauslieferung liegt in einem gemeinsamen Trait für die
Website-Route und die Redaktions-Route. Fehler der Übernahme erscheinen an derselben Stelle.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 06:55:36 +01:00

26 lines
745 B
PHP

<?php
namespace App\Http\Controllers;
use App\Domain\Catalog\ContentElement;
use App\Domain\Media\WebsiteMedia;
use App\Http\Controllers\Concerns\ServesByteRanges;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\StreamedResponse;
class WebsiteMediaController extends Controller
{
use ServesByteRanges;
public function show(Request $request, ContentElement $element, WebsiteMedia $media): StreamedResponse
{
$presentation = $media->present($element);
abort_if($presentation === null, 404);
$path = $element->website_public_path;
abort_if(! is_string($path), 404);
return $this->respondWithRanges($request, 'media_public', $path, $presentation->kind !== 'bild');
}
}