refactor(backend): group track pipeline state into owned types

Track mixed catalog fields (Title, Artist credit, Duration) with
picture-processing and audio-transcode pipeline state as ten flat
columns plus two computed [NotMapped] flags, making the entity read
like a media-pipeline worksheet.

Introduce TrackPictures and TrackAudio as EF owned types mapped onto
the same existing columns (explicit column names, no schema change -
verified via `dotnet ef migrations has-pending-model-changes`).
Track now reads as Title/Artist/Duration/Pictures/Audio instead of
fourteen loose properties.
This commit is contained in:
2026-07-17 17:58:56 +02:00
parent 64e1f3903e
commit daec1a8d05
19 changed files with 270 additions and 124 deletions
@@ -21,7 +21,7 @@ namespace Musify.Application.Tracks
{
var track = await database.Tracks.AsNoTracking()
.Where(t => t.Id == request.TrackId)
.Select(t => new { t.SmallPictureName, t.MediumPictureName, t.LargePictureName })
.Select(t => new { t.Pictures.SmallName, t.Pictures.MediumName, t.Pictures.LargeName })
.SingleOrDefaultAsync(cancellationToken);
if (track == null)
@@ -30,9 +30,9 @@ namespace Musify.Application.Tracks
var routes = trackConfiguration.Routes;
var (name, key) = request.Size.ToLowerInvariant() switch
{
"small" => (track.SmallPictureName, BuildKey(routes.BuildSmallPicturePath, track.SmallPictureName)),
"large" => (track.LargePictureName, BuildKey(routes.BuildLargePicturePath, track.LargePictureName)),
_ => (track.MediumPictureName, BuildKey(routes.BuildMediumPicturePath, track.MediumPictureName))
"small" => (track.SmallName, BuildKey(routes.BuildSmallPicturePath, track.SmallName)),
"large" => (track.LargeName, BuildKey(routes.BuildLargePicturePath, track.LargeName)),
_ => (track.MediumName, BuildKey(routes.BuildMediumPicturePath, track.MediumName))
};
if (string.IsNullOrEmpty(name) || key == null)