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

22 lines
939 B
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using YandexMusic.API.Models.Queue;
using YandexMusic.API.Requests.Queue;
namespace YandexMusic.API;
/// <summary>API для работы с очередями воспроизведения.</summary>
public class YQueueAPI : YCommonAPI
{
public YQueueAPI(YandexMusicApi api) : base(api) { }
public Task<YQueueItemsContainer?> ListAsync(string? device = null)
=> new YQueuesListBuilder(Api, device).ExecuteAsync(null!);
public Task<YQueue?> GetAsync(string queueId)
=> new YGetQueueBuilder(Api).ExecuteAsync(queueId);
public Task<YNewQueue?> CreateAsync(YQueue queue, string? device = null)
=> new YQueueCreateBuilder(Api, device).ExecuteAsync(queue);
public Task<YUpdatedQueue?> UpdatePositionAsync(string queueId, int currentIndex, bool isInteractive, string? device = null)
=> new YQueueUpdatePositionBuilder(Api, device).ExecuteAsync((queueId, currentIndex, isInteractive));
}