Полностью переписанное api
All checks were successful
Release / pack-and-publish (release) Successful in 36s

This commit is contained in:
FrigaT
2026-04-19 17:00:05 +03:00
parent 5541d0ad27
commit 36e28ce3fe
111 changed files with 1552 additions and 3358 deletions

View File

@@ -4,24 +4,25 @@ using YandexMusic.API.Models.Track;
namespace YandexMusic.API.Extensions.API;
/// <summary>
/// Методы-расширения для радиостанции
/// Методы-расширения для радиостанции.
/// </summary>
public static partial class YStationResultExtensions
public static class YStationResultExtensions
{
public static async Task<List<YSequenceItem>> GetTracksAsync(this YStation station, string prevTrackId = "")
{
return (await station.Context.API.Radio.GetStationTracksAsync(station.Context.Storage, station, prevTrackId))
.Result.Sequence;
}
/// <summary>
/// Получает список треков для радиостанции.
/// </summary>
public static async Task<List<YSequenceItem>?> GetTracksAsync(this YStation station, string prevTrackId = "")
=> (await station.Context.API.Radio.GetStationTracksAsync(station, prevTrackId))?.Sequence;
public static async Task<string> SetSettings2Async(this YStation station, YStationSettings2 settings)
{
return (await station.Context.API.Radio.SetStationSettings2Async(station.Context.Storage, station, settings))
.Result;
}
/// <summary>
/// Устанавливает настройки станции.
/// </summary>
public static async Task<string?> SetSettings2Async(this YStation station, YStationSettings2 settings)
=> await station.Context.API.Radio.SetStationSettings2Async(station, settings);
public static Task<string> SendFeedBackAsync(this YStation station, YStationFeedbackType type, YTrack track = null, string batchId = "", double totalPlayedSeconds = 0)
{
return station.Context.API.Radio.SendStationFeedBackAsync(station.Context.Storage, station, type, track, batchId, totalPlayedSeconds);
}
}
/// <summary>
/// Отправляет обратную связь о прослушивании.
/// </summary>
public static Task<string?> SendFeedbackAsync(this YStation station, YStationFeedbackType type, YTrack? track = null, string batchId = "", double totalPlayedSeconds = 0)
=> station.Context.API.Radio.SendStationFeedbackAsync(station, type, track, batchId, totalPlayedSeconds);
}