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

Favourites has no mixes() function to get the favourite mixes #197

Closed
Nokse22 opened this issue Sep 19, 2023 · 8 comments
Closed

Favourites has no mixes() function to get the favourite mixes #197

Nokse22 opened this issue Sep 19, 2023 · 8 comments

Comments

@Nokse22
Copy link

Nokse22 commented Sep 19, 2023

I checked the website and it is possible to see the favourite mixes and radios at https://listen.tidal.com/my-collection/mixes

Also adding/removing a mix from the favourite is not possible

@tehkillerbee
Copy link
Collaborator

I checked the website and it is possible to see the favourite mixes and radios at https://listen.tidal.com/my-collection/mixes

It seems you are right, mixes seem to be missing from favorites.

Feel free to add a PR, otherwise this will be added as soon as possible.

@Nokse22
Copy link
Author

Nokse22 commented Sep 28, 2023

I tried to add this feature myself, but I think it's not possible for now.
I tried to just do it the same way as the others, but it doesn't work. So I tried to see what requests the website made.

To get the favourite mixes it does:
https://listen.tidal.com/v2/favorites/mixes?offset=0&limit=50

instead for example for the albums it does:
https://listen.tidal.com/v1/users/12345678/favorites/albums?offset=0&limit=50

@Nokse22 Nokse22 changed the title Favourites has no Mixes() function to get the favourite mixes Favourites has no mixes() function to get the favourite mixes Sep 28, 2023
@tehkillerbee
Copy link
Collaborator

After looking further into this issue, it seems we already have a partial functionality for getting mixes found in your collection.

mixes = self._active_session.mixes()

Anyways, this does not currently work (for me, this page is just empty). Perhaps for legacy purposes?

As you correctly point out, using the same approach as albums does not work as expected. But if you use the web player to get favourite albums / mixes, you will notice that both of them use the v2 URL for the GET method. The python-tidal API was probably reverse engineered using an earlier version.

Perhaps it is possible to get the correct path to the mixes endpoints, using the v1 URL instead. Or perhaps the mixes endpoint does not exist for v1 - only v2?

@jozefKruszynski
Copy link
Contributor

After doing some exploratory testing, it's definitely possible to get the mixes from favourites.
It requires a few minor changes here and there, including the use of a v2 url, but the change for that is also minimal.
I'l try to add a PR in a couple of days.

@tehkillerbee
Copy link
Collaborator

After doing some exploratory testing, it's definitely possible to get the mixes from favourites. It requires a few minor changes here and there, including the use of a v2 url, but the change for that is also minimal. I'l try to add a PR in a couple of days.

Great to hear you found a solution. Perhaps we should consider using v2 links elsewhere in tidalapi.

@jozefKruszynski
Copy link
Contributor

I ended up having to create a MixV2 class as the structure is different enough to warrant it, however, this structure is only used for this one v2 api endpoint, and tidal themselves in their web app use the v1 api for every other call related to mixes.

It's a rather odd situation as you need to use the v2 endpoint to return a list of something that you then actually only ever need the name and ID of really.

I'll push a draft PR to make what I'm talking about a bit more tangible.

@tehkillerbee
Copy link
Collaborator

tehkillerbee commented Oct 22, 2023

@jozefKruszynski Great to hear you found a solution. I'll test out your pr and get it merged ASAP so we can get this feature in for the next release.

@tehkillerbee
Copy link
Collaborator

tehkillerbee commented Nov 29, 2023

Fixed in #207 (Thanks @jozefKruszynski ). Merged into master today, will be added to next release asap.

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

No branches or pull requests

3 participants