Extends the music library listings with covers, sorting and alpha filtering.

This commit is contained in:
BinaryAlley committed 2026-10-13 13:26:14 +03:00
1 parent 0019821e87
commit 9d82f283e4
69 files changed
+3613 -268

No files matched your search

@@ -157,8 +157,10 @@ public static class AlbumEntityMapping
/// Converts <paramref name="repositoryEntity"/> to <see cref="AlbumResponse"/>.
/// </summary>
/// <param name="repositoryEntity">The repository entity to be converted.</param>
/// <param name="coverPath">The optional path of the image representing the album.</param>
/// <param name="artwork">The optional stored artwork of the album, in display order.</param>
/// <returns>The converted response entity.</returns>
public static AlbumResponse ToResponse(this AlbumEntity repositoryEntity)
public static AlbumResponse ToResponse(this AlbumEntity repositoryEntity, string? coverPath = null, IReadOnlyList<MediaArtworkDto>? artwork = null)
{
ReleaseInfoDto releaseInfo = new(
repositoryEntity.OriginalReleaseDate,
@@ -220,7 +222,9 @@ public static class AlbumEntityMapping
repositoryEntity.UpdatedOnUtc,
[.. repositoryEntity.Contributors.Select(contributor => new MediaContributorReferenceDto(contributor.MediaContributorId, contributor.Role))],
[.. repositoryEntity.Ratings.ToResponses()],
[.. repositoryEntity.Tracks.Select(track => track.ToResponse())]);
[.. repositoryEntity.Tracks.Select(track => track.ToResponse())],
coverPath,
artwork ?? []);
}
/// <summary>
@@ -24,7 +24,10 @@ public static class AlbumLiteRowMapping
return new AlbumLiteResponse(
readModel.Id,
readModel.Title,
readModel.TotalTracks);
readModel.TotalTracks,
readModel.CoverPath,
readModel.ReleaseYear,
readModel.ReleaseTypes);
}
/// <summary>
@@ -147,8 +147,9 @@ public static class ArtistEntityMapping
/// Converts <paramref name="repositoryEntity"/> to <see cref="ArtistResponse"/>.
/// </summary>
/// <param name="repositoryEntity">The repository entity to be converted.</param>
/// <param name="coverPath">The optional path of the image representing the artist.</param>
/// <returns>The converted response entity.</returns>
public static ArtistResponse ToResponse(this ArtistEntity repositoryEntity)
public static ArtistResponse ToResponse(this ArtistEntity repositoryEntity, string? coverPath = null)
{
MusicArtistMetadataDto metadata = new(
repositoryEntity.Name,
@@ -178,7 +179,8 @@ public static class ArtistEntityMapping
repositoryEntity.UpdatedOnUtc,
[.. repositoryEntity.Contributors.Select(contributor => new MediaContributorReferenceDto(contributor.MediaContributorId, contributor.Role))],
[.. repositoryEntity.Ratings.ToResponses()],
[.. repositoryEntity.Albums.Select(album => album.ToResponse())]);
[.. repositoryEntity.Albums.Select(album => album.ToResponse())],
coverPath);
}
/// <summary>
@@ -23,7 +23,8 @@ public static class ArtistLiteRowMapping
{
return new ArtistLiteResponse(
readModel.Id,
readModel.Name);
readModel.Name,
readModel.CoverPath);
}
/// <summary>
@@ -30,6 +30,10 @@ public static class GetArtistsLiteRequestMapping
return new GetArtistsLiteQuery(
libraryId,
paginationData,
request.SearchTerm);
request.SearchTerm,
request.FilterAlphaKey,
request.ShouldIgnoreThePrefixForAlphaPicker,
request.SortBy,
request.SortOrder);
}
}
@@ -25,7 +25,8 @@ public static class TrackLiteRowMapping
readModel.Id,
readModel.Title,
readModel.TrackNumber,
readModel.DiscNumber);
readModel.DiscNumber,
readModel.DurationInSeconds);
}
/// <summary>