Wähle das Vorschaubild am Medium und nutze es als Standard in der Anzeige und in Modulen.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
f86032cb5f
commit
8e77defaca
18 files changed
+664
-26
No files matched your search
@@ -7,6 +7,7 @@
|
||||
use App\Domain\Catalog\CompositionDisplayRelease;
|
||||
use App\Domain\Catalog\CompositionStructureReader;
|
||||
use App\Domain\Catalog\CompositionVersion;
|
||||
use App\Domain\Catalog\ContentElement;
|
||||
use App\Domain\Catalog\ContentElementVersion;
|
||||
use App\Domain\Catalog\ReleaseStatus;
|
||||
use App\Domain\Catalog\StructureNode;
|
||||
@@ -14,6 +15,8 @@
|
||||
use App\Domain\Entitlement\Grant;
|
||||
use App\Domain\Entitlement\GrantStatus;
|
||||
use App\Domain\Media\MediaRendition;
|
||||
use App\Domain\Media\ThumbnailRef;
|
||||
use App\Filament\Support\EditorialCatalog;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
@@ -41,6 +44,7 @@ public function index(User $user): array
|
||||
$version = $release?->rootCompositionVersion;
|
||||
|
||||
if ($composition !== null && $version !== null && $this->display->isReleased($version)) {
|
||||
$picture = app(EditorialCatalog::class)->visiblePicture($composition, $version);
|
||||
$card = [
|
||||
'composition' => $composition,
|
||||
'version' => $version,
|
||||
@@ -49,6 +53,11 @@ public function index(User $user): array
|
||||
'kind' => $composition->editorialContentKind?->label
|
||||
?? ($composition->kind?->label()),
|
||||
'coverage' => $this->coverageLabel($user, $composition),
|
||||
'image' => $picture['alt'] ?? null,
|
||||
'image_url' => $picture === null ? null : route('member.thumbnail', [
|
||||
'kind' => $picture['kind'],
|
||||
'subject' => $picture['subject'],
|
||||
]),
|
||||
];
|
||||
$shelf = $composition->editorialContentKind?->slug === 'modul' ? 'modules' : 'programs';
|
||||
if ($shelf === 'modules') {
|
||||
@@ -65,12 +74,15 @@ public function index(User $user): array
|
||||
$key = $composition !== null
|
||||
? 'komposition-'.$composition->id
|
||||
: ($elementId !== null ? 'element-'.$elementId : 'artikel-'.$article->id);
|
||||
$imageUrl = $element === null ? null : ThumbnailRef::url('member.thumbnail', 'element', $element->id, $element->thumbnail_path);
|
||||
$materials[$key] = [
|
||||
'article' => $article,
|
||||
'title' => app(CourseOutline::class)->title($article),
|
||||
'summary' => $element?->summary ?? $composition?->summary,
|
||||
'kind' => app(CourseOutline::class)->kindLabel($article),
|
||||
'coverage' => 'nutzbar',
|
||||
'image' => $imageUrl === null ? null : ($element->thumbnail_alt ?: $element->working_title),
|
||||
'image_url' => $imageUrl,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -98,6 +110,7 @@ public function program(User $user, Composition $composition): array
|
||||
|
||||
return [
|
||||
'composition' => $composition,
|
||||
'picture' => app(EditorialCatalog::class)->visiblePicture($composition, $version),
|
||||
'title' => filled($composition->display_title) ? $composition->display_title : $composition->designation,
|
||||
'summary' => $composition->summary,
|
||||
'kind' => $composition->editorialContentKind?->label
|
||||
@@ -120,10 +133,16 @@ private function present(User $user, StructureNode $node): array
|
||||
|
||||
$playback = 'file';
|
||||
|
||||
$poster = null;
|
||||
|
||||
if ($node->contentElementVersionId !== null) {
|
||||
$view = $this->open($user, $node->contentElementVersionId, $this->viewAction($node->outputClass));
|
||||
$download = $this->open($user, $node->contentElementVersionId, 'laden');
|
||||
$playback = MediaRendition::masterPath($node->contentElementVersionId) !== null ? 'hls' : 'file';
|
||||
if ($view !== null && $node->contentElementId !== null) {
|
||||
$path = ContentElement::query()->whereKey($node->contentElementId)->value('thumbnail_path');
|
||||
$poster = ThumbnailRef::url('member.thumbnail', 'element', $node->contentElementId, $path);
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
@@ -133,6 +152,7 @@ private function present(User $user, StructureNode $node): array
|
||||
'output_class' => $node->outputClass,
|
||||
'playback' => $playback,
|
||||
'view_url' => $view,
|
||||
'poster_url' => $poster,
|
||||
'download_url' => $download,
|
||||
'program_url' => $this->programUrl($node),
|
||||
'children' => array_map(
|
||||
|
||||
Reference in new issue
Block a user