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
@@ -4,6 +4,7 @@
|
||||
|
||||
use App\Domain\Catalog\Composition;
|
||||
use App\Domain\Catalog\ContentElement;
|
||||
use App\Domain\Catalog\ContentElementVersion;
|
||||
use App\Domain\Media\ThumbnailDeriver;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Queue\Queueable;
|
||||
@@ -17,6 +18,8 @@ public function __construct(
|
||||
public readonly int $subjectId,
|
||||
public readonly ?string $incoming = null,
|
||||
public readonly ?int $fromElement = null,
|
||||
public readonly ?int $versionId = null,
|
||||
public readonly ?float $atSecond = null,
|
||||
) {}
|
||||
|
||||
public function handle(ThumbnailDeriver $deriver): void
|
||||
@@ -47,8 +50,26 @@ public function handle(ThumbnailDeriver $deriver): void
|
||||
|
||||
$element = ContentElement::query()->find($this->subjectId);
|
||||
|
||||
if ($element !== null) {
|
||||
$deriver->forElement($element);
|
||||
if ($element === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->versionId !== null && $this->atSecond !== null) {
|
||||
$version = ContentElementVersion::query()->find($this->versionId);
|
||||
|
||||
if ($version instanceof ContentElementVersion) {
|
||||
$deriver->forElementFrame($element, $version, $this->atSecond);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_string($this->incoming)) {
|
||||
$deriver->forElementUpload($element, $this->incoming);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$deriver->forElement($element);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user