Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
geloczi committed Dec 19, 2021
1 parent fb63b2f commit e450b42
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions SynologyDotNet.AudioStation/AudioStationClient.Playlist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ public async Task<ApiDataResponse<Playlist>> GetPlaylistAsync(int limit, int off
return new ApiDataResponse<Playlist>(playlists, playlists.Data?.Playlists?.FirstOrDefault() ?? default);
}

/// <summary>
/// Adds the songs to the playlist.
/// </summary>
/// <param name="id">Playlist ID</param>
/// <param name="songIds">The song IDs.</param>
/// <returns></returns>
public async Task<ApiResponse> AddSongsToPlaylist(string id, params string[] songIds)
{
return await Client.QueryObjectAsync<ApiResponse>(SYNO_AudioStation_Playlist, "updatesongs",
Expand All @@ -74,12 +80,11 @@ public async Task<ApiResponse> AddSongsToPlaylist(string id, params string[] son
/// Removes the selected song range from the specified playlist.
/// The Playlist API does NOT support removing songs by ID directly, you must query the playlist first.
/// </summary>
/// <param name="id">The identifier of the Playlist.</param>
/// <param name="id">Playlist ID.</param>
/// <param name="startIndex">The index of the first song to be deleted.</param>
/// <param name="count">The count of songs to be removed from start index.</param>
public async Task<ApiResponse> RemoveSongsFromPlaylist(string id, int startIndex, int count)
{
// The Playlist API does NOT support removing songs by ID, it is using the "offset" and "limit" parameters to define the range to remove.
return await Client.QueryObjectAsync<ApiResponse>(SYNO_AudioStation_Playlist, "updatesongs",
("id", id),
("offset", startIndex),
Expand Down

0 comments on commit e450b42

Please sign in to comment.