fix: register-new-then-remove-old in ReplaceTrackAudioAsync; replace wording in timeout messages; doc comment on ExistingTrackCount
On partial failure the old path deleted the original audio before confirming the new write succeeded. Now: load old extension, register new audio first (original untouched on failure), then clean up stale backing file only on success and only when extension changed.
This commit is contained in:
@@ -90,7 +90,8 @@ public class TrackReplaceAudioTests
|
||||
var content = CreateContentService(fileDatabase!);
|
||||
|
||||
// A .wav original replaced by a .flac: the backing filename is keyed by extension, so a
|
||||
// register-only swap would strand the old .wav. The replace removes the old entry first.
|
||||
// register-only swap would strand the old .wav. The replace writes the new entry first, then
|
||||
// cleans up the stale old backing file (detected by comparing old vs. new extension).
|
||||
var original = await WriteWavAsync(BuildMinimalPcmWav(2.0), ".wav");
|
||||
var seeded = await content.AddTrackAsync(original, "Original", "Artist");
|
||||
var entryKey = seeded!.EntryKey;
|
||||
|
||||
Reference in New Issue
Block a user