fix: different tracks with the same title, excluding special characters, were deduplicated from the album#428
Open
tikhonp wants to merge 1 commit intoswingmx:masterfrom
Open
fix: different tracks with the same title, excluding special characters, were deduplicated from the album#428tikhonp wants to merge 1 commit intoswingmx:masterfrom
tikhonp wants to merge 1 commit intoswingmx:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR attempts to fix a bug where tracks with the same title (excluding special characters) are incorrectly deduplicated from albums. The issue is demonstrated with Pink Floyd's "The Wall" album, where "In the Flesh?" (Disc 1, Track 1) and "In the Flesh" (Disc 2, Track 8) are treated as duplicates because the hash function strips non-alphanumeric characters.
Key Changes:
- Modified
recreate_trackhash()method to include track and disc numbers in the hash calculation
…rs, were deduplicated from the album
Contributor
Author
|
There was also an inconsistency with the hashing in taglib.py, the arguments were passed in a different order, that is now resolved too |
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.
What kind of change does this PR introduce? (check at least one)
The PR fulfills these requirements:
fix #xxx[,#xxx], where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information:
I have an album in my library the contents of which look like this:
There are two tracks,
01. In the Flesh?on Disc 1 and08. In the Fleshon Disc 2. However, in SwingMusic only the second track appears:As I discovered, this happens because the track hashes are identical for both tracks, even though the songs are different. The reason is that the hashing function ignores non-alphanumeric characters in the title, which generally makes sense but causes a bug in albums like this.
In this case, it might be enough to track only the track number, but in the worst-case scenario there may be albums where songs share the same track numbers across different discs, so I think it makes sense to include the disc number in the hash as well.