[CHANGE] Reworked entities and contexts
This commit is contained in:
43
Manager.Data/Entities/LibraryContext/MediaEntity.cs
Normal file
43
Manager.Data/Entities/LibraryContext/MediaEntity.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Manager.Data.Entities.LibraryContext.Join;
|
||||
|
||||
namespace Manager.Data.Entities.LibraryContext;
|
||||
|
||||
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,
|
||||
}
|
Reference in New Issue
Block a user