Files
YandexMusic/YandexMusic.API/Requests/Track/YTrackDownloadInfoBuilder.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
800 B
C#

using System.Collections.Specialized;
using System.Net;
using YandexMusic.API.Models.Common;
namespace YandexMusic.API.Requests.Track;
public class YTrackDownloadInfoBuilder : YMusicRequestBuilder<List<YTrackDownloadInfo>?, (string trackKey, bool direct)>
{
public YTrackDownloadInfoBuilder(YandexMusicApi api) : base(api) { }
protected override string Method => WebRequestMethods.Http.Get;
protected override string PathTemplate => "tracks/{trackKey}/download-info";
protected override Dictionary<string, string> GetSubstitutions((string trackKey, bool direct) tuple)
=> new() { { "trackKey", tuple.trackKey } };
protected override NameValueCollection GetQueryParams((string trackKey, bool direct) tuple)
=> new() { { "direct", tuple.direct.ToString() } };
}