Lege Bildfassungen an und liefere sie zwischengespeichert aus (ADR-63)
Vorschaubilder entstehen zusätzlich als klein (360 px) und mittel (960 px), Website-Bilder in den Breiten 640, 1280 und 1920. Auswahl, Listen und Karten laden die kleinen Fassungen; die Website nutzt srcset. Adressen tragen Größe und Version und werden dauerhaft zwischengespeichert (ETag, 304). Die Website-Route läuft ohne Sitzung und Cookies. Bestand füllt sich über die Warteschlange oder mit media:varianten. Die Optionsliste des CMS fragt nicht mehr je Eintrag ab. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0492133201
commit
63b42b366c
54 files changed
+1033
-82
No files matched your search
@@ -20,6 +20,7 @@
|
||||
use App\Domain\Media\FilmPlayback;
|
||||
use App\Domain\Media\HlsPlaylist;
|
||||
use App\Domain\Media\MediaRendition;
|
||||
use App\Http\Controllers\Concerns\ServesImages;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\CourseOutline;
|
||||
use App\Http\LibraryCatalog;
|
||||
@@ -32,10 +33,13 @@
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\View\View;
|
||||
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
|
||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
|
||||
class LibraryController extends Controller
|
||||
{
|
||||
use ServesImages;
|
||||
|
||||
/** Inhaltsarten der Bibliothek (Schlüssel der Adresse und des Filters). */
|
||||
public const TYPES = [
|
||||
'programm' => 'Programme',
|
||||
@@ -361,7 +365,7 @@ public function rendition(
|
||||
return $disk->response($datei, basename($datei), ['Content-Disposition' => 'inline']);
|
||||
}
|
||||
|
||||
public function thumbnail(Request $request, string $kind, int $subject): StreamedResponse
|
||||
public function thumbnail(Request $request, string $kind, int $subject): SymfonyResponse
|
||||
{
|
||||
abort_unless(in_array($kind, ['komposition', 'element'], true), 404);
|
||||
$model = $kind === 'komposition'
|
||||
@@ -373,7 +377,13 @@ public function thumbnail(Request $request, string $kind, int $subject): Streame
|
||||
$disk = Storage::disk('media_derived');
|
||||
abort_unless($disk->exists($path), 404);
|
||||
|
||||
return $disk->response($path);
|
||||
return $this->respondWithImage(
|
||||
$request,
|
||||
'media_derived',
|
||||
$this->imagePathFor($request, 'media_derived', $path),
|
||||
'private',
|
||||
$this->hasImageVersion($request),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user