Files
YandexMusic/YandexMusic.API/Requests/Radio/YGetStationTracksBuilder.cs
FrigaT add7f08215
All checks were successful
Release / pack-and-publish (release) Successful in 32s
Добавлен вывод AuthStorage. Спрятаны внутренние api запросы
2026-04-19 17:41:30 +03:00

21 lines
1.0 KiB
C#

using System.Collections.Specialized;
using System.Net;
using YandexMusic.API.Models.Radio;
namespace YandexMusic.API.Requests.Radio;
internal class YGetStationTracksBuilder : YMusicRequestBuilder<YStationSequence?, (YStationDescription station, string prevTrackId)>
{
public YGetStationTracksBuilder(YandexMusicApi api) : base(api) { }
protected override string Method => WebRequestMethods.Http.Get;
protected override string PathTemplate => "rotor/station/{type}:{tag}/tracks";
protected override Dictionary<string, string> GetSubstitutions((YStationDescription station, string prevTrackId) tuple)
=> new() { { "type", tuple.station.Id.Type }, { "tag", tuple.station.Id.Tag } };
protected override NameValueCollection GetQueryParams((YStationDescription station, string prevTrackId) tuple)
{
var query = new NameValueCollection { { "settings2", "true" } };
if (!string.IsNullOrEmpty(tuple.prevTrackId))
query.Add("queue", tuple.prevTrackId);
return query;
}
}