Block duplicate-release uploads by (title, artist): pre-flight check + server 409 backstop, with within-batch Cut attach via releaseId
This commit is contained in:
@@ -25,6 +25,10 @@ public interface ICmsTrackService
|
||||
/// sets Content-Length and is the denominator for <paramref name="progress"/>, which reports cumulative
|
||||
/// bytes pushed to the wire. Each progress tick also resets the idle/heartbeat upload timeout, so a
|
||||
/// stalled connection aborts without a fixed total-duration cap.
|
||||
/// <paramref name="releaseId"/> distinguishes the two rows of a within-batch multi-track Cut: null on
|
||||
/// the first row (CREATE — the server rejects a pre-existing (title, artist) as a duplicate) and the
|
||||
/// id returned by that first row on rows 2..N (ATTACH — the server skips the duplicate check and adds
|
||||
/// the track to the release the batch just created).
|
||||
/// </summary>
|
||||
Task<ResultContainer<TrackDto>> UploadTrackAsync(
|
||||
Stream wavStream,
|
||||
@@ -42,9 +46,20 @@ public interface ICmsTrackService
|
||||
ReleaseType releaseType,
|
||||
int trackNumber,
|
||||
ReleaseMedium medium = ReleaseMedium.Cut,
|
||||
long? releaseId = null,
|
||||
IProgress<long>? progress = null,
|
||||
CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Upload-form pre-flight: returns the existing release whose exact (title, artist) matches, or null
|
||||
/// when none exists. Backs the duplicate block the form runs BEFORE transferring bytes, so the admin
|
||||
/// is not surprised at the end of a long upload. A 404 from the API is the not-found (null) case, not
|
||||
/// a failure. The match semantics are the API's <c>GetReleaseByTitleAndArtist</c> — the same read the
|
||||
/// server backstop uses — so the pre-flight and the backstop agree.
|
||||
/// </summary>
|
||||
Task<ResultContainer<ReleaseDto?>> GetExistingReleaseAsync(
|
||||
string title, string artist, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Delete a track via the Content API, which removes the SQL row then the vault entry.
|
||||
/// Maps a 404 to a "Track not found." failure.
|
||||
|
||||
Reference in New Issue
Block a user