[CHANGE] Reworked db with interceptors

This commit is contained in:
max
2025-09-10 23:49:41 +02:00
parent b1e5b0dc68
commit 0f83cf1ddc
23 changed files with 293 additions and 79 deletions

View File

@@ -1,7 +1,9 @@
using System.ComponentModel.DataAnnotations;
using Manager.Data.Entities.Audit;
namespace Manager.Data.Entities.LibraryContext;
[Auditable]
public class CaptionEntity : DateTimeBase
{
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]

View File

@@ -1,7 +1,9 @@
using System.ComponentModel.DataAnnotations;
using Manager.Data.Entities.Audit;
namespace Manager.Data.Entities.LibraryContext;
[Auditable]
public class ChannelEntity : DateTimeBase
{
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]

View File

@@ -1,7 +1,9 @@
using System.ComponentModel.DataAnnotations;
using Manager.Data.Entities.Audit;
namespace Manager.Data.Entities.LibraryContext;
[Auditable]
public class ClientAccountEntity : DateTimeBase
{
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]

View File

@@ -1,9 +1,13 @@
using System.ComponentModel.DataAnnotations;
using Manager.Data.Entities.Audit;
namespace Manager.Data.Entities.LibraryContext;
[Auditable]
public class HttpCookieEntity : DateTimeBase
{
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]
public required string ClientId { get; set; }
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]
public required string Name { get; set; }
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]
@@ -15,6 +19,4 @@ public class HttpCookieEntity : DateTimeBase
public DateTimeOffset? ExpiresUtc { get; set; }
public bool Secure { get; set; }
public bool HttpOnly { get; set; }
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]
public required string ClientId { get; set; }
}

View File

@@ -1,8 +1,10 @@
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)]
@@ -17,7 +19,6 @@ public class MediaEntity : DateTimeBase
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;

View File

@@ -1,8 +1,10 @@
using System.ComponentModel.DataAnnotations;
using Manager.Data.Entities.Audit;
using Manager.Data.Entities.LibraryContext.Join;
namespace Manager.Data.Entities.LibraryContext;
[Auditable]
public class PlaylistEntity : DateTimeBase
{
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]