feat(backend): add the album use cases
Create, update, delete and list albums, plus adding and removing their tracks, mirroring the playlist handlers. Only tracks the user uploaded can go into an album, and removing one renumbers the rest so the tracklist stays 1..n.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using Musify.Domain.Entities;
|
||||
|
||||
namespace Musify.Application.Albums.Responses
|
||||
{
|
||||
public record AlbumApplicationResponse(
|
||||
Guid Id,
|
||||
string Title,
|
||||
string? Description,
|
||||
int? ReleaseYear,
|
||||
long OwnerUserId,
|
||||
int TrackCount,
|
||||
string? SmallImageKeyName,
|
||||
string? MediumImageKeyName,
|
||||
string? LargeImageKeyName,
|
||||
DateTime CreatedAt,
|
||||
DateTime UpdatedAt)
|
||||
{
|
||||
public static AlbumApplicationResponse FromEntity(UserAlbum album, int trackCount)
|
||||
{
|
||||
return new AlbumApplicationResponse(
|
||||
album.Id,
|
||||
album.Title,
|
||||
album.Description,
|
||||
album.ReleaseYear,
|
||||
album.OwnerUserId,
|
||||
trackCount,
|
||||
album.Pictures?.SmallName,
|
||||
album.Pictures?.MediumName,
|
||||
album.Pictures?.LargeName,
|
||||
album.CreatedAt,
|
||||
album.UpdatedAt);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user