Rewrite handlers

This commit is contained in:
2026-03-28 20:47:54 +01:00
parent 06ef70cb3b
commit 4fa341d2c8
12 changed files with 441 additions and 285 deletions
@@ -2,6 +2,7 @@
using DispatchR.Abstractions.Send;
using Musify.Application.Contracts.Application;
using Musify.Application.PlayLists.Responses;
using Musify.Domain.Entities;
namespace Musify.Application.PlayLists.Commands
{
@@ -10,5 +11,21 @@ namespace Musify.Application.PlayLists.Commands
string Name,
string Description,
IFileData? Picture)
: IRequest<CreatePlayListCommand, Task<Result<PlayListResponse>> >;
: IRequest<CreatePlayListCommand, Task<Result<PlayListResponse>> >
{
public static PlayList ToEntity(CreatePlayListCommand command, string originalKey, string smallKey, string mediumKey, string largeKey)
{
return new PlayList
{
UserId = command.UserId,
Name = command.Name,
NormalizedName = command.Name.Trim().ToUpperInvariant(),
Description = command.Description,
OriginalPictureName = originalKey,
SmallPictureName = smallKey,
MediumPictureName = mediumKey,
LargePictureName = largeKey,
};
}
}
}