37 lines
1.5 KiB
C#
37 lines
1.5 KiB
C#
using YandexMusic.API.Models.Radio;
|
||
using YandexMusic.API.Models.Track;
|
||
using YandexMusic.API.Requests.Radio;
|
||
|
||
namespace YandexMusic.API;
|
||
|
||
/// <summary>API для работы с радио.</summary>
|
||
public class YRadioAPI : YCommonAPI
|
||
{
|
||
public YRadioAPI(YandexMusicApi api) : base(api) { }
|
||
|
||
public Task<YStationsDashboard?> GetStationsDashboardAsync()
|
||
=> new YGetStationsDashboardBuilder(Api).ExecuteAsync(null!);
|
||
|
||
public Task<List<YStation>?> GetStationsAsync()
|
||
=> new YGetStationsBuilder(Api).ExecuteAsync(null!);
|
||
|
||
public Task<List<YStation>?> GetStationAsync(string type, string tag)
|
||
=> new YGetStationBuilder(Api).ExecuteAsync((type, tag));
|
||
|
||
public Task<List<YStation>?> GetStationAsync(YStationId id)
|
||
=> GetStationAsync(id.Type, id.Tag);
|
||
|
||
public Task<YStationSequence?> GetStationTracksAsync(YStation station, string prevTrackId = "")
|
||
=> new YGetStationTracksBuilder(Api).ExecuteAsync((station.Station, prevTrackId));
|
||
|
||
public Task<string?> SetStationSettings2Async(YStation station, YStationSettings2 settings)
|
||
=> new YSetSettings2Builder(Api).ExecuteAsync((station.Station, settings));
|
||
|
||
public Task<string?> SendStationFeedbackAsync(
|
||
YStation station,
|
||
YStationFeedbackType type,
|
||
YTrack? track = null,
|
||
string batchId = "",
|
||
double totalPlayedSeconds = 0)
|
||
=> new YSetStationFeedbackBuilder(Api).ExecuteAsync((type, station, track, batchId, totalPlayedSeconds));
|
||
} |