feat: add multi-disc support for album tagging #177
+895
−85
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.
This adds support for tagging albums that span multiple discs by detecting disc numbers in the MusicBrainz API response and writing them to the appropriate tags. Previously, tracks from multi-disc albums would all be tagged as if they were on a single disc, causing track number conflicts and incorrect metadata.
The implementation extracts disc and track position information from the MusicBrainz media array and writes it to both DISCNUMBER and DISCTOTAL tags. Track numbers are now disc-relative rather than absolute across the entire album. For single-disc releases, the behaviour remains unchanged with no disc tags written.
DestDir is renamed to AlbumRootDir which is calculated by finding the longest common prefix of all the tracks which retains the same logic for single disc (or unseperated tracks) but crucially now this path can contain folders below it which then contain the tracks. Covers and metadata are copied to the AlbumRootDir and is used to display where the release is.
applyRelease has been extracted from processDir to ensure that the directory lock does not leak and cause a deadlock if it returns an error.
The UI is updated to now show disc and tracks instead of albsolute track numbers.
DiscNumber and DiscTotal are available in PathFormat which allows releases to have discs in seperate folders.