Adds the media library artwork aggregation services, enrichers, and their provider contracts

This commit is contained in:
BinaryAlley committed 2026-10-09 01:59:00 +03:00
1 parent 00376c8313
commit 9e118864c3
33 files changed
+4621 -1118

No files matched your search

@@ -4,6 +4,7 @@ using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary;
using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary;
using Lumina.Plugins.Calibre.Core;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Threading;
@@ -34,12 +35,12 @@ public class CalibreArtworkProviderTests
BookMetadataLookupDto lookup = _bookMetadataLookupDtoFixture.Create(path: bookPath);
// Act
ArtworkDto? result = await _sut.GetArtworkAsync(lookup, CancellationToken.None);
IReadOnlyList<ArtworkDto> result = await _sut.GetArtworkAsync(lookup, CancellationToken.None);
// Assert
Assert.NotNull(result);
Assert.Equal(Path.Combine(bookDirectory, "cover.jpg"), result!.LocalPath);
Assert.Null(result.RemoteUrl);
ArtworkDto artwork = Assert.Single(result);
Assert.Equal(Path.Combine(bookDirectory, "cover.jpg"), artwork.LocalPath);
Assert.Null(artwork.RemoteUrl);
}
finally
{
@@ -59,10 +60,10 @@ public class CalibreArtworkProviderTests
BookMetadataLookupDto lookup = _bookMetadataLookupDtoFixture.Create(path: bookPath);
// Act
ArtworkDto? result = await _sut.GetArtworkAsync(lookup, CancellationToken.None);
IReadOnlyList<ArtworkDto> result = await _sut.GetArtworkAsync(lookup, CancellationToken.None);
// Assert
Assert.Null(result);
Assert.Empty(result);
}
finally
{
@@ -85,10 +86,10 @@ public class CalibreArtworkProviderTests
BookMetadataLookupDto lookup = _bookMetadataLookupDtoFixture.Create(path: bookPath);
// Act
ArtworkDto? result = await _sut.GetArtworkAsync(lookup, CancellationToken.None);
IReadOnlyList<ArtworkDto> result = await _sut.GetArtworkAsync(lookup, CancellationToken.None);
// Assert
Assert.Null(result);
Assert.Empty(result);
}
finally
{
@@ -108,10 +109,10 @@ public class CalibreArtworkProviderTests
BookMetadataLookupDto lookup = _bookMetadataLookupDtoFixture.Create(path: bookPath);
// Act
ArtworkDto? result = await _sut.GetArtworkAsync(lookup, CancellationToken.None);
IReadOnlyList<ArtworkDto> result = await _sut.GetArtworkAsync(lookup, CancellationToken.None);
// Assert
Assert.Null(result);
Assert.Empty(result);
}
finally
{
@@ -130,10 +131,10 @@ public class CalibreArtworkProviderTests
BookMetadataLookupDto lookup = _bookMetadataLookupDtoFixture.Create(path: bookPath);
// Act
ArtworkDto? result = await _sut.GetArtworkAsync(lookup, CancellationToken.None);
IReadOnlyList<ArtworkDto> result = await _sut.GetArtworkAsync(lookup, CancellationToken.None);
// Assert
Assert.Null(result);
Assert.Empty(result);
}
finally
{
@@ -153,10 +154,10 @@ public class CalibreArtworkProviderTests
BookMetadataLookupDto lookup = _bookMetadataLookupDtoFixture.Create(path: bookPath);
// Act
ArtworkDto? result = await _sut.GetArtworkAsync(lookup, CancellationToken.None);
IReadOnlyList<ArtworkDto> result = await _sut.GetArtworkAsync(lookup, CancellationToken.None);
// Assert
Assert.Null(result);
Assert.Empty(result);
}
finally
{