feat: add album and miscellaneous controllers with album mapping
All checks were successful
Update changelog / changelog (push) Successful in 26s

This commit is contained in:
2026-01-28 05:18:03 +01:00
parent 6736ce8c13
commit a1c9e3807b
4 changed files with 367 additions and 0 deletions

27
Mapping/AlbumMapping.cs Normal file
View File

@@ -0,0 +1,27 @@
using Shadow.DTOs;
using Shadow.Entities;
namespace Shadow.Mapping;
public static class AlbumMapping
{
public static AlbumViewShortDTO ToAlbumViewShort(Album album)
{
AlbumViewShortDTO dto = new AlbumViewShortDTO
{
id = $"{album.Id}",
name = album.Name,
artist = album.Artist?.Name ?? "[Unknown Artist]",
artistId = $"{album.ArtistId}",
coverArt = "default.png",
songCount = album.Songs.Count,
duration = album.Songs.Sum(s => s.Duration),
playCount = 0,
year = 0,
genre = "unknown",
// played = "never"
};
return dto;
}
}