[CHANGE] Reworked entities and contexts

This commit is contained in:
max
2025-08-18 00:46:40 +02:00
parent a62eeb727a
commit f784000393
18 changed files with 23 additions and 78 deletions

View 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,
}