ramsayleung / rspotify

Spotify Web API SDK implemented on Rust
MIT License
632 stars 121 forks source link

Add SimplifiedAlbum to SimplifiedTrack. #465

Closed channingbabb closed 6 months ago

channingbabb commented 6 months ago

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.

ramsayleung commented 6 months ago

Thanks for the contribution, the test_simplified_track test failed because you haven't updated the associated test yet.

channingbabb commented 6 months ago

Thanks for the contribution, the test_simplified_track test failed because you haven't updated the associated test yet.

I believe I updated it correctly now! Sorry about that!

ramsayleung commented 6 months ago

The CI workflows still failed.