16 lines
715 B
C#
16 lines
715 B
C#
using System.Net;
|
|
using YandexMusic.API.Models.Playlist;
|
|
|
|
namespace YandexMusic.API.Requests.Playlist;
|
|
|
|
internal class YGetPlaylistsBuilder : YMusicRequestBuilder<List<YPlaylist>?, IEnumerable<(string User, string Kind)>>
|
|
{
|
|
public YGetPlaylistsBuilder(YandexMusicApi api) : base(api) { }
|
|
protected override string Method => WebRequestMethods.Http.Post;
|
|
protected override string PathTemplate => "playlists/list";
|
|
protected override HttpContent? GetContent(IEnumerable<(string User, string Kind)> playlistIds)
|
|
=> new FormUrlEncodedContent(new Dictionary<string, string>
|
|
{
|
|
{ "playlist-Ids", string.Join(",", playlistIds.Select(t => $"{t.User}:{t.Kind}")) }
|
|
});
|
|
} |