45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using Manager.Data.Entities.Audit;
|
|
using Manager.Data.Entities.LibraryContext.Join;
|
|
|
|
namespace Manager.Data.Entities.LibraryContext;
|
|
|
|
[Auditable]
|
|
public class MediaEntity : DateTimeBase
|
|
{
|
|
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]
|
|
public required string Id { get; set; }
|
|
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]
|
|
public string? Title { get; set; }
|
|
[MaxLength(DataConstants.DbContext.DefaultDbDescriptionStringSize)]
|
|
public string? Description { get; set; }
|
|
public DateTime UploadDateUtc { get; set; }
|
|
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]
|
|
public required string ChannelId { get; set; }
|
|
public List<MediaFormatEntity> Formats { get; set; } = [];
|
|
public List<CaptionEntity> Captions { get; set; } = [];
|
|
public List<PlaylistMedia> PlaylistMedias { get; set; } = [];
|
|
public MediaExternalState ExternalState { get; set; } = MediaExternalState.Online;
|
|
public bool IsDownloaded { get; set; }
|
|
public MediaState State { get; set; } = MediaState.Indexed;
|
|
}
|
|
|
|
public enum MediaExternalState
|
|
{
|
|
Online,
|
|
Offline,
|
|
Limited,
|
|
Removed
|
|
}
|
|
|
|
[Flags]
|
|
public enum MediaState
|
|
{
|
|
None = 0,
|
|
Indexed = 1 << 0,
|
|
Downloading = 1 << 1,
|
|
Downloaded = 1 << 2,
|
|
Remove = 1 << 3,
|
|
Failed = 1 << 4,
|
|
}
|