Repository navigation
Consolidate: never overwrite an earlier render - #470
Open
ItsAlphaNeon wants to merge 1 commit into
Open
ItsAlphaNeon wants to merge 1 commit into
ItsAlphaNeon wants to merge 1 commit into
Conversation
Consolidate numbered its WAV by counting the files in the project's Rendered folder. A deleted render leaves a gap, and the count then lands on a file that is still there: with Consolidated 1.wav and 3.wav, the new render replaced 3, which a clip could still be playing. The file is now claimed before the render starts: the first free Consolidated N.wav is created only if it does not exist yet (create_new), which also keeps two renders into the same folder at once apart. A render that fails removes its claimed file. Fixes #469 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #469.
What was wrong
Playlist Consolidate numbered its WAV by counting the files in the project's
Renderedfolder and adding one. A deleted render leaves a gap, and the count then lands on a file that is still there: withConsolidated 1.wavandConsolidated 3.wav, the new render picked 3 and replaced it, though a clip could still be playing it.What changed
claim_consolidated(crates/os-app/src/playlist.rs) creates the first freeConsolidated N.wavwithFile::create_newbefore the render starts, so it takes a gap and never an existing file. Because the create is exclusive, two renders into the same folder at once (two projects, two app instances) each get their own file.Render::Consolidatecarries its path, and a render that fails (or writes nothing) removes it so the number stays free.This stays inside Consolidate: the shared export writer,
Joband the pattern render are unchanged. The pattern render already avoided this throughfile_stem.Tests
playlist_renders_play_hosted_pluginsnow consolidates into aRenderedfolder holdingConsolidated 1.wavandConsolidated 3.wav. It checks that the new file isConsolidated 2.wavand that both earlier files keep their bytes. On unchangedmainthis fails: file 3 is overwritten with the new WAV.consolidate_claims_a_free_file: it fills the gap, then the next free number, and 8 threads claiming at once each get a distinct file.playlisttests pass on Windows. Clippy reports no warnings on the changed lines.For the reviewer
Consolidated N.wavis left behind. Nothing references it, and later Consolidates skip it.🤖 Generated with Claude Code