Files
YandexMusic/YandexMusic.API/Requests/Playlist/YGetPlaylistsBuilder.cs
FrigaT 36e28ce3fe
All checks were successful
Release / pack-and-publish (release) Successful in 36s
Полностью переписанное api
2026-04-19 17:00:05 +03:00

16 lines
713 B
C#

using System.Net;
using YandexMusic.API.Models.Playlist;
namespace YandexMusic.API.Requests.Playlist;
public 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}")) }
});
}