Make release Medium writable via upload + meta-edit; resolve detail-page track by releaseId not album title

This commit is contained in:
daniel-c-harvey
2026-06-13 11:34:45 -04:00
parent ea018beb3e
commit 8b62915083
15 changed files with 314 additions and 28 deletions
@@ -53,6 +53,7 @@ public class UnifiedTrackService
long createdByUserId,
string? originalFileName,
ReleaseType releaseType,
ReleaseMedium medium,
int trackNumber,
CancellationToken ct)
{
@@ -81,9 +82,15 @@ public class UnifiedTrackService
Genre = genre,
ReleaseDate = releaseDate,
ReleaseType = releaseType,
Medium = medium,
CreatedByUserId = createdByUserId,
};
// Medium (like every other field in releaseData) applies only when this upload CREATES the
// release. FindOrCreateRelease returns an existing (title, artist) row untouched — the first
// upload's medium is authoritative. Do NOT "fix" this to overwrite the stored medium on a
// subsequent track add: medium is a release-level property, changed only via the edit path
// (PUT api/track/meta), never silently flipped by adding a track to an existing release.
var releaseResult = await _sqlTrackService.FindOrCreateRelease(album, artist, releaseData, ct);
if (!releaseResult.Success || releaseResult.Value is null)
{