diff --git a/CHANGELOG.md b/CHANGELOG.md index a26e8f61..f4575693 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ -## 0.12(unreleased) +## 0.12 (unreleased ) +**New features** - ([#390](https://github.com/ramsayleung/rspotify/pull/390)) The `scopes!` macro supports to split the scope by whitespace. +**Breaking changes** +- ([#409](https://github.com/ramsayleung/rspotify/pull/409)) Change type of `position` parameter in `playlist_add_items` endpoint from `Opinion` to `Opinion` + ## 0.11.7 (2023.04.26) - ([#399](https://github.com/ramsayleung/rspotify/pull/399)) Add a new variant `Collectionyourepisodes` for `Type` enum. diff --git a/src/clients/oauth.rs b/src/clients/oauth.rs index 80d74a4c..065a3a70 100644 --- a/src/clients/oauth.rs +++ b/src/clients/oauth.rs @@ -294,19 +294,19 @@ pub trait OAuthClient: BaseClient { /// Parameters: /// - playlist_id - the id of the playlist /// - track_ids - a list of track URIs, URLs or IDs - /// - position - the position to add the tracks + /// - position - the position to add the items, a zero-based index /// /// [Reference](https://developer.spotify.com/documentation/web-api/reference/#/operations/add-tracks-to-playlist) async fn playlist_add_items<'a>( &self, playlist_id: PlaylistId<'_>, items: impl IntoIterator> + Send + 'a, - position: Option, + position: Option, ) -> ClientResult { let uris = items.into_iter().map(|id| id.uri()).collect::>(); let params = JsonBuilder::new() .required("uris", uris) - .optional("position", position.map(|p| p.num_milliseconds())) + .optional("position", position) .build(); let url = format!("playlists/{}/tracks", playlist_id.id());