Phase 9 Wave 1: add ReleaseMedium discriminator + Session/Mix metadata
Add ReleaseMedium enum (Cut/Session/Mix) and two 1:1 satellite entities (SessionMetadata, MixMetadata) with EF configs and an additive migration. ReleaseDto.ReleaseType is now nullable, nulled for non-Cut at the converter. Existing releases default to Cut via column default; no data migration.
This commit is contained in:
@@ -3,6 +3,7 @@ using Data.Managers;
|
||||
using DeepDrftData.Repositories;
|
||||
using DeepDrftModels.DTOs;
|
||||
using DeepDrftModels.Entities;
|
||||
using DeepDrftModels.Enums;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Models.Common;
|
||||
using NetBlocks.Models;
|
||||
@@ -263,7 +264,10 @@ public class TrackManager
|
||||
releaseEntity.Genre = release.Genre;
|
||||
releaseEntity.ReleaseDate = release.ReleaseDate;
|
||||
releaseEntity.ImagePath = release.ImagePath;
|
||||
releaseEntity.ReleaseType = release.ReleaseType;
|
||||
releaseEntity.Medium = release.Medium;
|
||||
// DTO ReleaseType is nullable (meaningful only for Cut); the entity field is not.
|
||||
// Default to Single when null, matching TrackConverter.Convert(ReleaseDto).
|
||||
releaseEntity.ReleaseType = release.ReleaseType ?? ReleaseType.Single;
|
||||
releaseEntity.CreatedByUserId = release.CreatedByUserId;
|
||||
await Repository.UpdateReleaseAsync(releaseEntity);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user