Moves media library scanning to domain layer

This commit is contained in:
BinaryAlley committed 2025-02-16 21:45:26 +02:00
1 parent 8b51abe0b2
commit c4246d2e69
209 files changed
+3793 -641

No files matched your search

@@ -41,10 +41,15 @@ public class LibraryEntity : IStorageEntity, IAuditableEntity
public required LibraryType LibraryType { get; set; }
/// <summary>
/// Gets or sets the list of file system paths that make up the media library.
/// Gets the list of file system paths that make up the media library.
/// </summary>
public required ICollection<LibraryContentLocationEntity> ContentLocations { get; init; } = [];
/// <summary>
/// Gets the list of scans of the media library.
/// </summary>
public ICollection<LibraryScanEntity> LibraryScans { get; init; } = [];
/// <summary>
/// Gets whether this media library is enabled or not. A disabled media library is never shown or changed.
/// </summary>
@@ -0,0 +1,66 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Application.Common.DataAccess.Entities.UsersManagement;
using Lumina.Domain.Common.Enums.MediaLibrary;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
/// <summary>
/// Repository entity for a media library.
/// </summary>
[DebuggerDisplay("Id: {Id}; Status: {Status}")]
public class LibraryScanEntity : IStorageEntity, IAuditableEntity
{
/// <summary>
/// Gets the Id of the media library.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets the Id of the media library that is scanned.
/// </summary>
public required Guid LibraryId { get; init; }
/// <summary>
/// Gets the Id of the user that initiated the media library scan.
/// </summary>
public required Guid UserId { get; init; }
/// <summary>
/// Gets the status of the media library scan.
/// </summary>
public required LibraryScanJobStatus Status { get; init; }
/// <summary>
/// Gets the media library that is scanned.
/// </summary>
public required LibraryEntity Library { get; init; } = null!;
/// <summary>
/// Gets the user that initiated the media library scan.
/// </summary>
public required UserEntity User { get; init; } = null!;
/// <summary>
/// Gets or sets the time and date when the entity was added.
/// </summary>
public required DateTime CreatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the Id of the user that created the entity.
/// </summary>
public required Guid CreatedBy { get; set; }
/// <summary>
/// Gets or sets the optional time and date when the entity was updated.
/// </summary>
public DateTime? UpdatedOnUtc { get; set; }
/// <summary>
/// Gets or sets the optional Id of the user that updated the entity.
/// </summary>
public required Guid? UpdatedBy { get; set; }
}