#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Plugins;
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Application.Common.Infrastructure.Plugins;
///
/// Store of the metadata and artwork provider configurations of the media libraries.
///
public interface IMediaLibraryProviderConfigurationStore
{
///
/// Gets the metadata provider configurations of the media library identified by .
///
/// The Id of the media library whose metadata provider configurations are retrieved.
/// Cancellation token that can be used to stop the execution.
/// An containing either the configurations, or an error.
Task>> GetConfigurationsAsync(Guid libraryId, CancellationToken cancellationToken);
///
/// Adds a disabled provider configuration for every loaded plugin that supports the provided library type and has no
/// configuration yet for the media library identified by .
///
/// The Id of the media library whose provider configurations are ensured.
/// The type of the media library, used to determine the plugins whose providers apply.
/// Cancellation token that can be used to stop the execution.
/// An representing either a successful operation, or an error.
Task> EnsureProviderConfigurationsAsync(Guid libraryId, LibraryType libraryType, CancellationToken cancellationToken);
///
/// Replaces the provider configurations of the media library identified by so that they
/// match the plugins supporting the provided library type.
///
/// The Id of the media library whose provider configurations are reconciled.
/// The type of the media library, used to determine the plugins whose providers apply.
/// Cancellation token that can be used to stop the execution.
/// An representing either a successful operation, or an error.
Task> ReconcileProviderConfigurationsAsync(Guid libraryId, LibraryType libraryType, CancellationToken cancellationToken);
///
/// Deletes all the provider configurations of the media library identified by .
///
/// The Id of the media library whose provider configurations are deleted.
/// Cancellation token that can be used to stop the execution.
/// An representing either a successful operation, or an error.
Task> RemoveProviderConfigurationsForLibraryAsync(Guid libraryId, CancellationToken cancellationToken);
///
/// Deletes all the provider configurations referencing the plugin identified by .
///
/// The Id of the plugin whose provider configurations are deleted.
/// Cancellation token that can be used to stop the execution.
/// An representing either a successful operation, or an error.
Task> RemoveProviderConfigurationsAsync(Guid pluginId, CancellationToken cancellationToken);
}