| | | 1 | | using Anichron.Core.Domain; |
| | | 2 | | |
| | | 3 | | namespace Anichron.Worker.Ingestion; |
| | | 4 | | |
| | | 5 | | internal sealed record SecondaryFileDescriptor( |
| | | 6 | | string AbsolutePath, |
| | | 7 | | string RelativePath, |
| | | 8 | | MediaType MediaType); |
| | | 9 | | |
| | | 10 | | internal abstract record IngestionItem(string AbsolutePath, string RelativePath) |
| | | 11 | | { |
| | | 12 | | public abstract MediaType PrimaryMediaType { get; } |
| | | 13 | | public abstract SecondaryFileDescriptor? SecondaryFile { get; } |
| | | 14 | | } |
| | | 15 | | |
| | | 16 | | internal sealed record SingleFileItem( |
| | | 17 | | string AbsolutePath, |
| | | 18 | | string RelativePath, |
| | | 19 | | MediaType MediaType) : IngestionItem(AbsolutePath, RelativePath) |
| | | 20 | | { |
| | 16 | 21 | | public override MediaType PrimaryMediaType => MediaType; |
| | 30 | 22 | | public override SecondaryFileDescriptor? SecondaryFile => null; |
| | | 23 | | } |
| | | 24 | | |
| | | 25 | | internal sealed record LivePhotoPairItem( |
| | | 26 | | string AbsolutePath, |
| | | 27 | | string RelativePath, |
| | | 28 | | string MovAbsolutePath, |
| | | 29 | | string MovRelativePath) : IngestionItem(AbsolutePath, RelativePath) |
| | | 30 | | { |
| | | 31 | | public override MediaType PrimaryMediaType => MediaType.LivePhoto; |
| | | 32 | | public override SecondaryFileDescriptor? SecondaryFile => new(MovAbsolutePath, MovRelativePath, MediaType.Video); |
| | | 33 | | } |