using ErsatzTV.Core; using ErsatzTV.Core.Interfaces.Repositories; namespace ErsatzTV.Application.Maintenance; public class DeleteOrphanedArtworkHandler : IRequestHandler> { private readonly IArtworkRepository _artworkRepository; public DeleteOrphanedArtworkHandler(IArtworkRepository artworkRepository) => _artworkRepository = artworkRepository; public Task> Handle(DeleteOrphanedArtwork request, CancellationToken cancellationToken) => _artworkRepository.GetOrphanedArtwork() .Bind(_artworkRepository.Delete) .Map(_ => Right(Unit.Default)); }