Adds media library advanced options

This commit is contained in:
BinaryAlley committed 2025-01-25 12:27:50 +02:00
1 parent 1c28355197
commit f89ba4960a
60 files changed
+1877 -51

No files matched your search

@@ -45,6 +45,26 @@ public class LibraryEntity : IStorageEntity, IAuditableEntity
/// </summary>
public required ICollection<LibraryContentLocationEntity> ContentLocations { get; init; } = [];
/// <summary>
/// Gets whether this media library is enabled or not. A disabled media library is never shown or changed.
/// </summary>
public bool IsEnabled { get; init; }
/// <summary>
/// Gets whether this media library is locked or not. A locked media library is displayed, but is never changed or updated.
/// </summary>
public bool IsLocked { get; init; }
/// <summary>
/// Gets whether this media library should update the metadata of its elements from the web, or not.
/// </summary>
public bool DownloadMedatadaFromWeb { get; init; }
/// <summary>
/// Gets whether this media library should copy the downloaded metadata into the media library content locations, or not.
/// </summary>
public bool SaveMetadataInMediaDirectories { get; init; }
/// <summary>
/// Gets the user that owns the media library.
/// </summary>
@@ -1,8 +1,12 @@
#region ========================================================================= USING =====================================================================================
using ErrorOr;
using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
using Lumina.Application.Common.DataAccess.Repositories.Common.Actions;
using Lumina.Application.Common.DataAccess.Repositories.Common.Base;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Application.Common.DataAccess.Repositories.MediaLibrary;
@@ -17,4 +21,17 @@ public interface ILibraryRepository : IRepository<LibraryEntity>,
IUpdateRepositoryAction<LibraryEntity>,
IDeleteByIdRepositoryAction<Guid>
{
/// <summary>
/// Gets all media libraries that are marked as enabled and unlocked, from the storage medium.
/// </summary>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="ErrorOr{TValue}"/> containing either a collection of <see cref="LibraryEntity"/>, or an error.</returns>
Task<ErrorOr<IEnumerable<LibraryEntity>>> GetAllEnabledAndUnlockedAsync(CancellationToken cancellationToken);
/// <summary>
/// Gets all media libraries that are marked as enabled from the storage medium.
/// </summary>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="ErrorOr{TValue}"/> containing either a collection of <see cref="LibraryEntity"/>, or an error.</returns>
Task<ErrorOr<IEnumerable<LibraryEntity>>> GetAllEnabledAsync(CancellationToken cancellationToken);
}