[CHANGE] Updated string maxsize on entities. Setup lib dbcontext

This commit is contained in:
max
2025-08-17 18:54:20 +02:00
parent 7f7e137a92
commit b6453d8bf6
12 changed files with 168 additions and 18 deletions

View File

@@ -1,21 +1,29 @@
using System.ComponentModel.DataAnnotations;
using Manager.Data.Models.LibraryContext.Join;
namespace Manager.Data.Models.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 MediaState State { get; set; } = MediaState.Online;
public MediaExternalState ExternalState { get; set; } = MediaExternalState.Online;
public bool IsDownloaded { get; set; }
public MediaProcessState ProcessState { get; set; } = MediaProcessState.ToDownload;
public MediaState State { get; set; } = MediaState.Indexed;
}
public enum MediaState
public enum MediaExternalState
{
Online,
Offline,
@@ -23,11 +31,13 @@ public enum MediaState
Removed
}
public enum MediaProcessState
[Flags]
public enum MediaState
{
ToDownload,
Downloaded,
ToRemove,
Removed,
Failed
None = 0,
Indexed = 1 << 0,
Downloading = 1 << 1,
Downloaded = 1 << 2,
Remove = 1 << 3,
Failed = 1 << 4,
}