[GH-ISSUE #488] Unavailable tracks in market are still returned by playlist_items() #157

Closed
opened 2026-02-27 20:23:28 +03:00 by kerem · 3 comments
Owner

Originally created by @feldroop on GitHub (Aug 8, 2024).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/488

Describe the bug
I use the function AuthCodeSpotify::playlist_items(...) and I noticed that the returned list contains playlist items/tracks that are not avalaible in my current country/market. As an input to the function, I supplied my current market (=my home country). I additinally noticed that the field FullTrack::available_markets seems to always be an empty Vec.

To Reproduce
Should be clear from my explanation. You just need a spotify playlist with one available and one unavailable song in your market or the one that you use to debug. If it helps, this song is not available in my country, maybe it can help you debug: https://open.spotify.com/intl-de/track/6EkG9mwbTCmM94kueLnlPo

Expected behavior
As the spotify API states, I would expect that unavailable tracks are filtered out from the return value of the playlist_items function. Also I expect the mentioned field to not always be an empty Vec.

Log/Output data

Additional context

Originally created by @feldroop on GitHub (Aug 8, 2024). Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/488 **Describe the bug** I use the function `AuthCodeSpotify::playlist_items(...)` and I noticed that the returned list contains playlist items/tracks that are not avalaible in my current country/market. As an input to the function, I supplied my current market (=my home country). I additinally noticed that the field `FullTrack::available_markets` seems to always be an empty Vec. **To Reproduce** Should be clear from my explanation. You just need a spotify playlist with one available and one unavailable song in your market or the one that you use to debug. If it helps, this song is not available in my country, maybe it can help you debug: https://open.spotify.com/intl-de/track/6EkG9mwbTCmM94kueLnlPo **Expected behavior** As the spotify API states, I would expect that unavailable tracks are filtered out from the return value of the `playlist_items` function. Also I expect the mentioned field to not always be an empty Vec. **Log/Output data** - **Additional context** -
kerem 2026-02-27 20:23:28 +03:00
Author
Owner

@ramsayleung commented on GitHub (Sep 13, 2024):

I noticed that the returned list contains playlist items/tracks that are not avalaible in my current country/market.

How would you know these items and tracks are unavailble in your current country?

I would expect that unavailable tracks are filtered out from the return value of the playlist_items function.

How would the library know whether the tracks are available in your current country? This library should be a lightweight client to help user call the Spotify server, it should not do everything for user.

If other users hope to get unavailable tracks in their countries, what should this library do if it filters out the unavailable tracks?

Also I expect the mentioned field to not always be an empty Vec.

This is Spotify's responsibility, you couldn't ask a library to populate the values which supposed to handled by the Spotify server, this library has no idea how to keep FullTrack::available_markets not always be empty.

<!-- gh-comment-id:2348250562 --> @ramsayleung commented on GitHub (Sep 13, 2024): > I noticed that the returned list contains playlist items/tracks that are not avalaible in my current country/market. How would you know these items and tracks are unavailble in your current country? > I would expect that unavailable tracks are filtered out from the return value of the playlist_items function. How would the library know whether the tracks are available in your current country? This library should be a lightweight client to help user call the Spotify server, it should not do everything for user. If other users hope to get unavailable tracks in their countries, what should this library do if it filters out the unavailable tracks? > Also I expect the mentioned field to not always be an empty Vec. This is Spotify's responsibility, you couldn't ask a library to populate the values which supposed to handled by the Spotify server, this library has no idea how to keep `FullTrack::available_markets` not always be empty.
Author
Owner

@feldroop commented on GitHub (Sep 13, 2024):

How would you know these items and tracks are unavailble in your current country?

They are greyed out in the Spotify app GUI and can't be played. I manually checked it.

How would the library know whether the tracks are available in your current country? This library should be a lightweight client to help user call the Spotify server, it should not do everything for user.

Of course only Spotify has the information about the availibility of tracks in different markets. This could be an issue of the Spotify servers or the way this library calls the Spotify API. Feel free to close this if you feel like the former is the case. I merely wanted to report the issue and don't disagree with the purpose of this library.

If other users hope to get unavailable tracks in their countries, what should this library do if it filters out the unavailable tracks?

The function ...::playlist_items receives the market input exactly for the purpose of filtering out unavailable tracks, as documented in the Spotify API reference. I only expect for this behavior to happen. Of course you shouldn't do any unsolicited filtering for all users.

This is Spotify's responsibility, you couldn't ask a library to populate the values which supposed to handled by the Spotify server, this library has no idea how to keep FullTrack::available_markets not always be empty.

As I mentioned previously, I agree and only wanted to report.

<!-- gh-comment-id:2348626672 --> @feldroop commented on GitHub (Sep 13, 2024): > How would you know these items and tracks are unavailble in your current country? They are greyed out in the Spotify app GUI and can't be played. I manually checked it. > How would the library know whether the tracks are available in your current country? This library should be a lightweight client to help user call the Spotify server, it should not do everything for user. Of course only Spotify has the information about the availibility of tracks in different markets. This could be an issue of the Spotify servers or the way this library calls the Spotify API. Feel free to close this if you feel like the former is the case. I merely wanted to report the issue and don't disagree with the purpose of this library. > If other users hope to get unavailable tracks in their countries, what should this library do if it filters out the unavailable tracks? The function `...::playlist_items` receives the `market` input exactly for the purpose of filtering out unavailable tracks, as documented in the Spotify API reference. I only expect for this behavior to happen. Of course you shouldn't do any unsolicited filtering for all users. > This is Spotify's responsibility, you couldn't ask a library to populate the values which supposed to handled by the Spotify server, this library has no idea how to keep FullTrack::available_markets not always be empty. As I mentioned previously, I agree and only wanted to report.
Author
Owner

@ramsayleung commented on GitHub (Sep 13, 2024):

Thanks for your report, in order to help Spotify improve their API and services, I strongly encourage you to cut a ticket and report this kind of problem in their offical forum, reporting to developer of 3rd-party library has a little help on improving the quanlity of Spotify API.

There are countless reports around the broken response returned from the Spotify, like #492 and this one, I've also cut a ticket and contacted their customer support to report the broken problem:

https://community.spotify.com/t5/Spotify-for-Developers/The-response-type-of-artist-endpoint-is-marked-as-Integer-in/m-p/5825937#M12321

Honestly speaking, I am a bit frustrated with dealing with the broken problems caused by Spotify while they also don't actively work on reducing these recurring issues.

Anyway, thanks for your report again, it will definitely help other users who has the similar concern and issue.

<!-- gh-comment-id:2349268709 --> @ramsayleung commented on GitHub (Sep 13, 2024): Thanks for your report, in order to help Spotify improve their API and services, I strongly encourage you to cut a ticket and report this kind of problem in their offical [forum](https://community.spotify.com/), reporting to developer of 3rd-party library has a little help on improving the quanlity of Spotify API. There are countless reports around the broken response returned from the Spotify, like #492 and [this one](https://github.com/aome510/spotify-player/issues/494#issuecomment-2212812838), I've also cut a ticket and contacted their customer support to report the broken problem: https://community.spotify.com/t5/Spotify-for-Developers/The-response-type-of-artist-endpoint-is-marked-as-Integer-in/m-p/5825937#M12321 Honestly speaking, I am a bit frustrated with dealing with the broken problems caused by Spotify while they also don't actively work on reducing these recurring issues. Anyway, thanks for your report again, it will definitely help other users who has the similar concern and issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rspotify#157
No description provided.