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>
This commit is contained in:
1 parent
ef3af0e036
commit
be932c113a
7 files changed
+182
-82
No files matched your search
@@ -2,12 +2,15 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Domain\Catalog\ContentElement;
|
||||
use App\Domain\Catalog\ContentElementVersion;
|
||||
use App\Domain\Identity\StaffRole;
|
||||
use App\Domain\Media\FilmPlayback;
|
||||
use App\Domain\Media\HlsPlaylist;
|
||||
use App\Domain\Media\MediaRendition;
|
||||
use App\Http\Controllers\Concerns\ServesByteRanges;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\View\View;
|
||||
@@ -15,6 +18,27 @@
|
||||
|
||||
class ContentPreviewController extends Controller
|
||||
{
|
||||
use ServesByteRanges;
|
||||
|
||||
/**
|
||||
* Die Website-Datei eines Films oder Hörstücks, damit die Redaktion sie vor der Freigabe ansehen kann. Nur für
|
||||
* angemeldete Redakteure; öffentlich ist erst die freigegebene Kopie (`website.media`).
|
||||
*/
|
||||
public function websiteFile(Request $request, ContentElement $element): StreamedResponse
|
||||
{
|
||||
$this->authorizeStaff();
|
||||
$path = $element->preview_path;
|
||||
|
||||
abort_unless(
|
||||
is_string($path) && str_starts_with($path, 'teaser/') && ! str_contains($path, '..')
|
||||
&& in_array($element->output_class, ['film', 'audio'], true)
|
||||
&& Storage::disk('media_derived')->exists($path),
|
||||
404,
|
||||
);
|
||||
|
||||
return $this->respondWithRanges($request, 'media_derived', $path, true);
|
||||
}
|
||||
|
||||
public function show(ContentElementVersion $version): View
|
||||
{
|
||||
$this->authorizeStaff();
|
||||
|
||||
Reference in new issue
Block a user