fix: urify logic for Apple Music and Deezer #549
Merged
+115
−117
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.
Before this patch, the
urify
command didn't work as expected with Apple Music and Deezer.Outright broken with Apple Music parsing, with the error:
And failing to return URLs when requested (
--url
) for Deezer.Working on this patch, I also realized Apple Music URLs need to be qualified with the album IDs.
So, with a URL of https://music.apple.com/us/album/say-so-feat-nicki-minaj/1510821672?i=1510821685
The previous URIfication would result in
apple_music:track:1510821685
And attempting to reconstruct a URL from that would be missing the album ID -
1510821672
This patch extends the format of the Apple Music URIfied format. Specifically for tracks.
So instead of
apple_music:track:1510821685
, it now comes prepended with the album ID. Delineated with ani
Becoming
apple_music:track:1510821672i1510821685
And finally, I noticed the Apple Music parsing logic did not account for periods
.
in the ID position. And playlists have exactly that. This has been patched as well.