[PR #207] [MERGED] filter out unplayable/unavailable tracks #664

Closed
opened 2026-03-02 23:49:16 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/aome510/spotify-player/pull/207
Author: @rileyallyn
Created: 6/2/2023
Status: Merged
Merged: 9/4/2023
Merged by: @aome510

Base: masterHead: feat/mark-unavailable


📝 Commits (6)

  • 4399804 feat: first pass on marking tracks unavailable or unplayable
  • 8527375 feat: refactor internal_call and paging code in order to support query payloads
  • 1d9256d fix: better unicode icon for unplayable music
  • ee0e9fa feat: make unavailable tracks unplayable
  • 7f1ac3d Merge branch 'master' into feat/mark-unavailable
  • b7d936a filter out unplayable tracks

📊 Changes

2 files changed (+74 additions, -41 deletions)

View changed files

📝 spotify_player/src/client/mod.rs (+50 -25)
📝 spotify_player/src/state/model.rs (+24 -16)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/aome510/spotify-player/pull/207 **Author:** [@rileyallyn](https://github.com/rileyallyn) **Created:** 6/2/2023 **Status:** ✅ Merged **Merged:** 9/4/2023 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `master` ← **Head:** `feat/mark-unavailable` --- ### 📝 Commits (6) - [`4399804`](https://github.com/aome510/spotify-player/commit/4399804f647b7733ae786e4a6de1e15656113e45) feat: first pass on marking tracks unavailable or unplayable - [`8527375`](https://github.com/aome510/spotify-player/commit/8527375c40a62f2838b426f3dd56a069a33f4d68) feat: refactor internal_call and paging code in order to support query payloads - [`1d9256d`](https://github.com/aome510/spotify-player/commit/1d9256d8fbb4e21b6f5b738da172d6577d3fe39b) fix: better unicode icon for unplayable music - [`ee0e9fa`](https://github.com/aome510/spotify-player/commit/ee0e9fa214b21d8e00bd7d26a179cd7c1ebf20af) feat: make unavailable tracks unplayable - [`7f1ac3d`](https://github.com/aome510/spotify-player/commit/7f1ac3d675fd29b8e1afc058fb4e86a6c65a1bd9) Merge branch 'master' into feat/mark-unavailable - [`b7d936a`](https://github.com/aome510/spotify-player/commit/b7d936a2a1f05198b22f6792604579ad8e01aa2d) filter out unplayable tracks ### 📊 Changes **2 files changed** (+74 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `spotify_player/src/client/mod.rs` (+50 -25) 📝 `spotify_player/src/state/model.rs` (+24 -16) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:49:16 +03:00
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/spotify-player#664
No description provided.