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:
2026-07-20 20:10:45 +02:00
parent 67805062ca
commit 69468c9dbd
10 changed files with 518 additions and 0 deletions
@@ -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);
}
}
}