mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 14:11:10 +00:00
Adds music page play affordances and shuffle playback
Adds play and shuffle actions to music library, artist, and album cards. Adds the library play context and the uniform shuffle endpoint. Expands the player bar with queue covers, now playing details, and release type. Updates the bundled themes, API documentation, and the user manual.
This commit is contained in:
1 parent
93821a2776
commit
067e9a21d0
132 files changed
+2935
-715
No files matched your search
+2
-1
@@ -170,7 +170,7 @@ public static class AlbumEntityMapping
|
||||
repositoryEntity.ReleaseCountry,
|
||||
repositoryEntity.ReleaseVersion
|
||||
);
|
||||
// language and original language make sense only if their subproperties have values
|
||||
// Language and original language make sense only if their subproperties have values.
|
||||
LanguageInfoDto? languageInfo = !string.IsNullOrWhiteSpace(repositoryEntity.LanguageCode) ||
|
||||
!string.IsNullOrWhiteSpace(repositoryEntity.LanguageName) ||
|
||||
!string.IsNullOrWhiteSpace(repositoryEntity.LanguageNativeName)
|
||||
@@ -207,6 +207,7 @@ public static class AlbumEntityMapping
|
||||
return new AlbumResponse(
|
||||
repositoryEntity.Id,
|
||||
repositoryEntity.ArtistId,
|
||||
repositoryEntity.Artist?.Name ?? string.Empty,
|
||||
repositoryEntity.LibraryId,
|
||||
metadata,
|
||||
repositoryEntity.MediaFormat,
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
|
||||
using Lumina.Contracts.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for converting <see cref="ShuffleTrackRowDto"/>.
|
||||
/// </summary>
|
||||
public static class ShuffleTrackRowDtoMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts <paramref name="readModel"/> to <see cref="ShuffleTrackResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="readModel">The read model to be converted.</param>
|
||||
/// <returns>The converted response.</returns>
|
||||
public static ShuffleTrackResponse ToResponse(this ShuffleTrackRowDto readModel)
|
||||
{
|
||||
return new ShuffleTrackResponse(
|
||||
readModel.TrackId,
|
||||
readModel.Title,
|
||||
readModel.DurationInSeconds,
|
||||
readModel.AlbumId,
|
||||
readModel.AlbumTitle,
|
||||
readModel.ArtistId,
|
||||
readModel.CoverPath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts <paramref name="readModels"/> to a collection of <see cref="ShuffleTrackResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="readModels">The read models to be converted.</param>
|
||||
/// <returns>The converted responses.</returns>
|
||||
public static IReadOnlyList<ShuffleTrackResponse> ToResponses(this IEnumerable<ShuffleTrackRowDto> readModels)
|
||||
{
|
||||
return [.. readModels.Select(readModel => readModel.ToResponse())];
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.MediaLibrary.AudioLibrary.MusicLibrary.Tracks.Queries.ShuffleTracks;
|
||||
using Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for converting <see cref="ShuffleTracksRequest"/>.
|
||||
/// </summary>
|
||||
public static class ShuffleTracksRequestMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts <paramref name="request"/> to <see cref="ShuffleTracksQuery"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <param name="libraryId">The Id of the library the tracks are sampled from, taken from the route.</param>
|
||||
/// <returns>The converted query.</returns>
|
||||
public static ShuffleTracksQuery ToQuery(this ShuffleTracksRequest request, string? libraryId)
|
||||
{
|
||||
return new ShuffleTracksQuery(
|
||||
libraryId,
|
||||
request.Count,
|
||||
request.ArtistId,
|
||||
request.AlbumId,
|
||||
request.ExcludedTrackIds);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user