mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 18:13:42 +00:00
Refactors the book, artist, and album slices across the stack
This commit is contained in:
1 parent
8aaf9fe64e
commit
ea6eb9f796
439 files changed
+28235
-3156
No files matched your search
+5
-2
@@ -19,19 +19,22 @@ public class UpdateBookCoverCommandFixture
|
||||
/// <summary>
|
||||
/// Creates a random valid <see cref="UpdateBookCoverCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">Optional. The Id of the media library the book belongs to.</param>
|
||||
/// <param name="bookId">Optional. The Id of the book whose cover is updated.</param>
|
||||
/// <param name="cover">Optional. The stream of the uploaded cover image file.</param>
|
||||
/// <param name="fileName">Optional. The name of the uploaded cover image file.</param>
|
||||
/// <param name="includeCover">Whether the cover stream should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <returns>The created <see cref="UpdateBookCoverCommand"/>.</returns>
|
||||
public UpdateBookCoverCommand Create(
|
||||
Guid? bookId = null,
|
||||
string? libraryId = null,
|
||||
string? bookId = null,
|
||||
Stream? cover = null,
|
||||
string? fileName = null,
|
||||
bool includeCover = true)
|
||||
{
|
||||
return new UpdateBookCoverCommand(
|
||||
bookId ?? Guid.NewGuid(),
|
||||
libraryId ?? Guid.NewGuid().ToString(),
|
||||
bookId ?? Guid.NewGuid().ToString(),
|
||||
includeCover ? (cover ?? CreateCoverStream()) : null,
|
||||
fileName ?? "cover.jpg"
|
||||
);
|
||||
|
||||
+4
-2
@@ -17,12 +17,14 @@ public class GetReadingAvailabilityQueryFixture
|
||||
/// <summary>
|
||||
/// Creates a random valid query to check the reading availability of a book.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">Optional. The Id of the library the book belongs to.</param>
|
||||
/// <param name="bookId">Optional. The Id of the book whose reading availability is checked.</param>
|
||||
/// <returns>The created <see cref="GetReadingAvailabilityQuery"/>.</returns>
|
||||
public GetReadingAvailabilityQuery Create(
|
||||
Guid? bookId = null)
|
||||
string? libraryId = null,
|
||||
string? bookId = null)
|
||||
{
|
||||
return new GetReadingAvailabilityQuery(bookId ?? Guid.NewGuid());
|
||||
return new GetReadingAvailabilityQuery(libraryId ?? Guid.NewGuid().ToString(), bookId ?? Guid.NewGuid().ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+4
-2
@@ -17,12 +17,14 @@ public class GetReadingManifestQueryFixture
|
||||
/// <summary>
|
||||
/// Creates a random valid query to get the reading manifest of a book.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">Optional. The Id of the library the book belongs to.</param>
|
||||
/// <param name="bookId">Optional. The Id of the book whose reading manifest is retrieved.</param>
|
||||
/// <returns>The created <see cref="GetReadingManifestQuery"/>.</returns>
|
||||
public GetReadingManifestQuery Create(
|
||||
Guid? bookId = null)
|
||||
string? libraryId = null,
|
||||
string? bookId = null)
|
||||
{
|
||||
return new GetReadingManifestQuery(bookId ?? Guid.NewGuid());
|
||||
return new GetReadingManifestQuery(libraryId ?? Guid.NewGuid().ToString(), bookId ?? Guid.NewGuid().ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+4
-2
@@ -17,14 +17,16 @@ public class GetReadingResourceQueryFixture
|
||||
/// <summary>
|
||||
/// Creates a random valid query to get a resource of a book.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">Optional. The Id of the library the book belongs to.</param>
|
||||
/// <param name="bookId">Optional. The Id of the book whose resource is retrieved.</param>
|
||||
/// <param name="resourceKey">Optional. The opaque resource key of the resource.</param>
|
||||
/// <returns>The created <see cref="GetReadingResourceQuery"/>.</returns>
|
||||
public GetReadingResourceQuery Create(
|
||||
Guid? bookId = null,
|
||||
string? libraryId = null,
|
||||
string? bookId = null,
|
||||
string? resourceKey = null)
|
||||
{
|
||||
return new GetReadingResourceQuery(bookId ?? Guid.NewGuid(), resourceKey ?? $"resource-{Guid.NewGuid():N}");
|
||||
return new GetReadingResourceQuery(libraryId ?? Guid.NewGuid().ToString(), bookId ?? Guid.NewGuid().ToString(), resourceKey ?? $"resource-{Guid.NewGuid():N}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+4
-2
@@ -17,14 +17,16 @@ public class GetReadingSectionQueryFixture
|
||||
/// <summary>
|
||||
/// Creates a random valid query to get the content of a reading section of a book.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">Optional. The Id of the library the book belongs to.</param>
|
||||
/// <param name="bookId">Optional. The Id of the book whose reading section is retrieved.</param>
|
||||
/// <param name="locationRef">Optional. The opaque location reference of the reading section.</param>
|
||||
/// <returns>The created <see cref="GetReadingSectionQuery"/>.</returns>
|
||||
public GetReadingSectionQuery Create(
|
||||
Guid? bookId = null,
|
||||
string? libraryId = null,
|
||||
string? bookId = null,
|
||||
string? locationRef = null)
|
||||
{
|
||||
return new GetReadingSectionQuery(bookId ?? Guid.NewGuid(), locationRef ?? $"section-{Guid.NewGuid():N}");
|
||||
return new GetReadingSectionQuery(libraryId ?? Guid.NewGuid().ToString(), bookId ?? Guid.NewGuid().ToString(), locationRef ?? $"section-{Guid.NewGuid():N}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in new issue
Block a user