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:
@@ -66,13 +66,19 @@ namespace Musify.Application.Tracks
|
||||
Title = request.Title,
|
||||
NormalizedTitle = request.Title.ToUpperInvariant(),
|
||||
OwnerUserId = user.Id,
|
||||
OriginalPictureName = pictureIntent.ObjectName,
|
||||
OriginalAudioName = audioIntent.ObjectName,
|
||||
SmallPictureName = trackConfiguration.Routes.PresetSmallPicture,
|
||||
MediumPictureName = trackConfiguration.Routes.PresetMediumPicture,
|
||||
LargePictureName = trackConfiguration.Routes.PresetLargePicture,
|
||||
PicturesProcessingStatus = ProcessingStatus.Pending,
|
||||
AudioTranscodeProcessingStatus = ProcessingStatus.Pending
|
||||
Pictures = new TrackPictures
|
||||
{
|
||||
OriginalName = pictureIntent.ObjectName,
|
||||
SmallName = trackConfiguration.Routes.PresetSmallPicture,
|
||||
MediumName = trackConfiguration.Routes.PresetMediumPicture,
|
||||
LargeName = trackConfiguration.Routes.PresetLargePicture,
|
||||
ProcessingStatus = ProcessingStatus.Pending
|
||||
},
|
||||
Audio = new TrackAudio
|
||||
{
|
||||
OriginalName = audioIntent.ObjectName,
|
||||
TranscodeStatus = ProcessingStatus.Pending
|
||||
}
|
||||
};
|
||||
|
||||
await database.Tracks.AddAsync(trackEntity, cancellationToken);
|
||||
|
||||
Reference in New Issue
Block a user