Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: urify logic for Apple Music and Deezer #549

Merged
merged 2 commits into from
Aug 7, 2023
Merged

Conversation

miraclx
Copy link
Owner

@miraclx miraclx commented Aug 7, 2023

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:

TypeError: Cannot read private member #store from an object whose class did not declare it
    at Object.parseURI (file:///freyr-js/src/services/apple_music.js:103:50)
    at FreyrCore.parseURI (file:///freyr-js/src/freyr.js:43:39)

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 an i

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.

@github-actions
Copy link

github-actions bot commented Aug 7, 2023


🐋 🤖

A docker image for this PR has been built!

docker pull freyrcli/freyrjs-git:pr-549
Base (master)
This Patch


What's this?

This docker image is a self-contained sandbox that includes all the patches made in this PR. Allowing others to easily use your patches without waiting for it to get merged and released officially.

For more context, see https://github.com/miraclx/freyr-js#docker-development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant