Repository navigation
Truncate long path components for MusicBrainz titles (#453) - #706
Open
ajzrva-sys wants to merge 2 commits into
Open
ajzrva-sys wants to merge 2 commits into
ajzrva-sys wants to merge 2 commits into
Conversation
Finish the approach from PR whipper-team#672 (lcorbasson) so extremely long release/track titles no longer raise ENAMETOOLONG during makedirs or flac writes. - truncate_filename: NAME_MAX via existing-ancestor pathconf with a 255-byte fallback; optional reserve= for extensions the caller appends - truncate_path_components + getPath: truncate every template segment, reserving room on the last component for .flac/.log/.cue - cdrdao TOC copy truncates directory components before makedirs - cd rip truncates the final track path after appending .flac Closes whipper-team#453. Closes whipper-team#565. Completes whipper-team#672. Signed-off-by: ajzrva-sys <ajzrva-sys@users.noreply.github.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.
Long MusicBrainz titles can exceed the filesystem's filename limit and stop a rip. This truncates each template component and leaves room for
.flac,.log,.cueand.tocextensions.Limits are resolved from each component's actual destination directory or nearest existing ancestor. Expansion retains the output directory and already-truncated parents, including when nested output directories do not exist yet. Filename templates and output-directory spelling retain their existing behavior. This change is separate from the hierarchy and collision work in #702.
This continues the work in #672 for #453 and #565.
Validated on macOS arm64 / Python 3.11.16: 131 unit tests pass. Deterministic destination-filesystem tests simulate 128- and 255-byte NAME_MAX limits, relative and absolute destinations, missing directories, Unicode, extension reservations, numbered track separation and the existing renamer's collision refusal. The new regressions produce 18 failing subcases on the previous implementation. Full flake8 reports the same 17 pre-existing findings, with none introduced by this correction.
No actual cross-filesystem or optical-drive validation was performed. This correction does not introduce a new collision naming policy or replace the work in #702.