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

filter out unplayable/unavailable tracks #207

Merged
merged 6 commits into from
Sep 4, 2023

Conversation

rileyallyn
Copy link
Contributor

@rileyallyn rileyallyn commented Jun 2, 2023

Resolves #158.
Resolves #211.

The purpose of this PR is to filter out unavailable songs. This functionality is achieved by utilizing Spotify's song relinking feature, specifically by sending the market query parameter and using from_token to retrieve the user's country code from their token.

A track is filtered out if its is_playable is false.

This did require a non significant refactor with the functions that call internal_call and the various internal pagination functions. But by making a "generic" payload field allows for more flexibility in the future if Spotify adds more query params.

@aome510 aome510 marked this pull request as ready for review September 4, 2023 16:28
@aome510 aome510 changed the title feat: Mark unplayable/unavailable tracks filter out unplayable/unavailable tracks Sep 4, 2023
@aome510 aome510 merged commit 24049c7 into aome510:master Sep 4, 2023
4 checks passed
@apprehensions
Copy link
Contributor

Why not mark it as unplayable and have it still exist in the playlist under a 'grayed-out' color?

@aome510
Copy link
Owner

aome510 commented Sep 7, 2023

Why not mark it as unplayable and have it still exist in the playlist under a 'grayed-out' color?

To avoid possible conflict with other commands (for example PlayRandom). IMO, I don't see any point of showing such unplayable tracks, but you want it as a feature, it's not difficult to implement.

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