-
-
Notifications
You must be signed in to change notification settings - Fork 366
Expand file tree
/
Copy pathVideoPartnerDTO.php
More file actions
50 lines (42 loc) · 1.13 KB
/
VideoPartnerDTO.php
File metadata and controls
50 lines (42 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* SPDX-License-Identifier: MIT
* Copyright (c) 2017-2018 Tobias Reich
* Copyright (c) 2018-2025 LycheeOrg.
*/
namespace App\DTO\PhotoCreate;
use App\Contracts\Image\StreamStats;
use App\Contracts\PhotoCreate\PhotoDTO;
use App\Image\Files\BaseMediaFile;
use App\Models\Photo;
use Illuminate\Support\Collection;
class VideoPartnerDTO implements PhotoDTO
{
public StreamStats|null $stream_stat;
public string $video_path;
public function __construct(
public readonly BaseMediaFile $video_file,
// The resulting photo
public readonly Photo $photo,
public readonly bool $shall_import_via_symlink,
public readonly bool $shall_delete_imported,
) {
}
public function getPhoto(): Photo
{
return $this->photo;
}
public function getTags(): Collection
{
return $this->photo->tags;
}
public static function ofInit(InitDTO $init_dto): VideoPartnerDTO
{
return new VideoPartnerDTO(
video_file: $init_dto->source_file,
photo: $init_dto->live_partner,
shall_import_via_symlink: $init_dto->import_mode->shall_import_via_symlink,
shall_delete_imported: $init_dto->import_mode->shall_delete_imported,
);
}
}