Repository navigation
Unused media: never offer another project's files (data loss with two projects in one folder) - #81
Open
marcin-koziol wants to merge 2 commits into
Open
marcin-koziol wants to merge 2 commits into
marcin-koziol wants to merge 2 commits into
Conversation
Projects saved in one folder share its Audio folder (a song and its master side by side). Closing one offered every file there that it did not use, so the master's close sent the song's recordings to the trash and the song opened with every track offline. Unused media are now only the files the project brought there itself: a source of the saved file, a saved version or the open session names it, and nothing saved uses it any more. A file no source of the project names (another project's, one put there by hand) is never offered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A project saved under a new name and cut down still lists the original's recordings among its sources, so its unused media offered files the original plays. Every other project file in the folder now counts: what it uses is never offered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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 #82 (critical: loses user data).
What happened
A song and its master project were saved side by side in the same folder, so they shared one
Audiofolder. When the master project was closed, the unused-media prompt offered every file in that folder the master did not use, which included all of the song's recordings. They were moved to the trash, and the song then opened with every audio track offline. The files were recovered from the trash, but anyone who empties their trash would lose them for good.Cause
Session::unused_mediastarted from every audio file inAudio/and removed the ones the saved project and its versions use. A file that no source of this project ever named, such as another project's recording, therefore always counted as unused.Fix
A file is a candidate only if the project itself brought it into the folder, meaning a source names it in at least one of:
Among those, files that nothing saved still uses are offered, as before. A file that no source of the project names is never offered, whether it belongs to another project or was put there by hand. The rest of the behaviour is unchanged: files named elsewhere in a saved file are kept, subfolders are left alone, and nothing is offered when a saved file cannot be read.
Tests
another_projects_files_in_the_same_folder_are_never_offered. Two projects are saved in one folder. Closing the master offers only its own removed scrap, never the song's vocal. Closing the song offers nothing of the master's.only_files_no_saved_state_uses_are_unused. A stray file inAudio/that no source names used to be offered. It is now kept, because it cannot be told apart from another project's recording.scratch_padspasses,clippy -D warningsonfaderframe-sessionis clean, and so isfmt --check.docs/ARCHITECTURE.md, in the Unused media section, now describes the new rule.🤖 Generated with Claude Code