mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-23 22:56:25 +00:00
Adds collaborative bool and description to UpdatePlaylist
This commit is contained in:
parent
5c2a901f75
commit
acc59d11bf
@ -1438,15 +1438,21 @@ namespace SpotifyAPI.Web
|
||||
/// <param name="playlistId">The Spotify ID for the playlist.</param>
|
||||
/// <param name="newName">The new name for the playlist, for example "My New Playlist Title".</param>
|
||||
/// <param name="newPublic">If true the playlist will be public, if false it will be private.</param>
|
||||
/// <param name="newCollaborative">If true the playlist will become collaborative and other users will be able to modify the playlist in their Spotify client. Note: You can only set collaborative to true on non-public playlists.</param>
|
||||
/// <param name="newDescription">Value for playlist description as displayed in Spotify Clients and in the Web API.</param>
|
||||
/// <returns></returns>
|
||||
/// <remarks>AUTH NEEDED</remarks>
|
||||
public ErrorResponse UpdatePlaylist(string userId, string playlistId, string newName = null, bool? newPublic = null)
|
||||
public ErrorResponse UpdatePlaylist(string userId, string playlistId, string newName = null, bool? newPublic = null, bool? newCollaborative = null, string newDescription = null)
|
||||
{
|
||||
JObject body = new JObject();
|
||||
if (newName != null)
|
||||
body.Add("name", newName);
|
||||
if (newPublic != null)
|
||||
body.Add("public", newPublic);
|
||||
if (newCollaborative != null)
|
||||
body.Add("collaborative", newCollaborative);
|
||||
if (newDescription != null)
|
||||
body.Add("description", newDescription);
|
||||
return UploadData<ErrorResponse>(_builder.UpdatePlaylist(userId, playlistId), body.ToString(Formatting.None), "PUT") ?? new ErrorResponse();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user