Changes
This commit is contained in:
@@ -11,7 +11,6 @@ using Musify.Domain.ValueObjects;
|
||||
|
||||
namespace Musify.Application.PlayLists
|
||||
{
|
||||
/// <summary>Appends every track of an album to a playlist in album order, skipping the ones it already has.</summary>
|
||||
public record AddAlbumToPlayListCommand(long UserId, Guid PlayListId, Guid AlbumId)
|
||||
: ICommand<ErrorOr<AddAlbumToPlayListResponse>>;
|
||||
|
||||
@@ -54,7 +53,6 @@ namespace Musify.Application.PlayLists
|
||||
if (newTrackIds.Count == 0)
|
||||
return new AddAlbumToPlayListResponse(0);
|
||||
|
||||
// Playlist positions are internal indexes, so they start at 0.
|
||||
var nextPosition = existingTrackIds.Count > 0
|
||||
? await playListTracksQuery.MaxAsync(link => link.Position, cancellationToken) + 1
|
||||
: 0;
|
||||
|
||||
@@ -9,7 +9,6 @@ using Musify.Domain.ValueObjects;
|
||||
|
||||
namespace Musify.Application.PlayLists
|
||||
{
|
||||
/// <summary>Appends tracks to a playlist in the given order, skipping the ones it already has.</summary>
|
||||
public record AddTracksToPlayListCommand(long UserId, Guid PlayListId, IReadOnlyList<Guid> TrackIds)
|
||||
: ICommand<ErrorOr<Success>>;
|
||||
|
||||
@@ -46,7 +45,6 @@ namespace Musify.Application.PlayLists
|
||||
if (toAdd.Count == 0)
|
||||
return Result.Success;
|
||||
|
||||
// Playlist positions are internal indexes, so they start at 0.
|
||||
var playListTracksQuery = database.PlayListHasTracks
|
||||
.Where(link => link.PlayListId == request.PlayListId);
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ namespace Musify.Application.PlayLists
|
||||
|
||||
var playList = found.Value;
|
||||
|
||||
// This is a full replace of the plain fields; the picture has its own command.
|
||||
playList.Name = request.NewName.Trim();
|
||||
playList.NormalizedName = TextNormalizer.Normalize(request.NewName);
|
||||
playList.Description = string.IsNullOrWhiteSpace(request.NewDescription) ? null : request.NewDescription.Trim();
|
||||
|
||||
@@ -13,7 +13,6 @@ using Musify.Domain.ValueObjects;
|
||||
|
||||
namespace Musify.Application.PlayLists
|
||||
{
|
||||
/// <summary>Replaces a playlist's picture with a previously uploaded image; the plain fields are untouched.</summary>
|
||||
public record UpdatePlayListPictureCommand(long UserId, Guid PlayListId, Guid PictureIntentId)
|
||||
: ICommand<ErrorOr<PlayListApplicationResponse>>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user