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:
@@ -51,19 +51,19 @@ namespace Musify.Application.PlayLists
|
||||
|
||||
var track = provisionResult.Value.Track;
|
||||
|
||||
var failed = track.AudioTranscodeProcessingStatus == ProcessingStatus.Failed;
|
||||
var neverQueued = !track.DownloadRequested && !track.IsAudioProcessed;
|
||||
var failed = track.Audio.TranscodeStatus == ProcessingStatus.Failed;
|
||||
var neverQueued = !track.Audio.DownloadRequested && !track.Audio.IsProcessed;
|
||||
if (failed || neverQueued)
|
||||
{
|
||||
if (failed)
|
||||
{
|
||||
track.AudioTranscodeProcessingStatus = ProcessingStatus.Pending;
|
||||
track.PicturesProcessingStatus = ProcessingStatus.Pending;
|
||||
track.Audio.TranscodeStatus = ProcessingStatus.Pending;
|
||||
track.Pictures.ProcessingStatus = ProcessingStatus.Pending;
|
||||
track.LifeCycleStatus = LifeCycleStatus.Active;
|
||||
track.RetryCount += 1;
|
||||
track.LastRetryAt = DateTime.UtcNow;
|
||||
track.Audio.RetryCount += 1;
|
||||
track.Audio.LastRetryAt = DateTime.UtcNow;
|
||||
}
|
||||
track.DownloadRequested = true;
|
||||
track.Audio.DownloadRequested = true;
|
||||
|
||||
var thumbnailUrl = await ResolveThumbnailUrlAsync(request.VideoId, provisionResult.Value.Song, cancellationToken);
|
||||
if (thumbnailUrl.IsError)
|
||||
|
||||
Reference in New Issue
Block a user