[PR #465] [MERGED] Add SimplifiedAlbum to SimplifiedTrack. #474

Closed
opened 2026-02-27 20:24:51 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ramsayleung/rspotify/pull/465
Author: @channingbabb
Created: 3/8/2024
Status: Merged
Merged: 3/9/2024
Merged by: @ramsayleung

Base: masterHead: master


📝 Commits (3)

  • d7db6e7 Add SimplifiedAlbum to SimplifiedTrack.
  • b3cb764 Modified model test.
  • 9ffb9b2 Skip if Option is none. Tracks fetched from the album have no album within the track object.

📊 Changes

2 files changed (+47 additions, -1 deletions)

View changed files

📝 rspotify-model/src/track.rs (+2 -0)
📝 tests/test_models.rs (+45 -1)

📄 Description

Description

This adds SimplifiedAlbum member to the SimplifiedTrack struct.

Motivation and Context

Found this issue through the recommendations API.
Fixes: https://github.com/ramsayleung/rspotify/issues/464#issue-2176647918

Type of change

Please delete options that are not relevant.

- [X] Bug fix (non-breaking change which fixes an issue)

How has this been tested?

Using this function:

pub async fn get_user_suggestions(spotify_session: AuthCodeSpotify) -> Recommendations {
    let seed_artists = [ArtistId::from_id("4NHQUGzhtTLFvgF5SZesLK").unwrap()];

    let attributes = [RecommendationsAttribute::MinEnergy(0.4)];

    let recommendations: Recommendations = spotify_session.recommendations(
        attributes,
        Some(seed_artists),
        None::<Vec<&str>>,
        Some(None),
        Some(Market::Country(Country::UnitedStates)),
        Some(100)
    )
        .await
        .unwrap();

    recommendations
}

You were not able to see Album information prior to the member addition.


🔄 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/ramsayleung/rspotify/pull/465 **Author:** [@channingbabb](https://github.com/channingbabb) **Created:** 3/8/2024 **Status:** ✅ Merged **Merged:** 3/9/2024 **Merged by:** [@ramsayleung](https://github.com/ramsayleung) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (3) - [`d7db6e7`](https://github.com/ramsayleung/rspotify/commit/d7db6e7c28872dd25bc0330aa0658354b993594b) Add SimplifiedAlbum to SimplifiedTrack. - [`b3cb764`](https://github.com/ramsayleung/rspotify/commit/b3cb7642995b9a9e1732a3a67602215153334ef9) Modified model test. - [`9ffb9b2`](https://github.com/ramsayleung/rspotify/commit/9ffb9b267e87010609d4c93028de35a6c7b65e39) Skip if Option is none. Tracks fetched from the album have no album within the track object. ### 📊 Changes **2 files changed** (+47 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `rspotify-model/src/track.rs` (+2 -0) 📝 `tests/test_models.rs` (+45 -1) </details> ### 📄 Description ## Description This adds SimplifiedAlbum member to the SimplifiedTrack struct. ## Motivation and Context Found this issue through the recommendations API. Fixes: https://github.com/ramsayleung/rspotify/issues/464#issue-2176647918 ## Type of change Please delete options that are not relevant. **- [X] Bug fix (non-breaking change which fixes an issue)** ## How has this been tested? Using this function: pub async fn get_user_suggestions(spotify_session: AuthCodeSpotify) -> Recommendations { let seed_artists = [ArtistId::from_id("4NHQUGzhtTLFvgF5SZesLK").unwrap()]; let attributes = [RecommendationsAttribute::MinEnergy(0.4)]; let recommendations: Recommendations = spotify_session.recommendations( attributes, Some(seed_artists), None::<Vec<&str>>, Some(None), Some(Market::Country(Country::UnitedStates)), Some(100) ) .await .unwrap(); recommendations } You were not able to see Album information prior to the member addition. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:24:51 +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/rspotify#474
No description provided.