Полностью переписанное api
All checks were successful
Release / pack-and-publish (release) Successful in 36s
All checks were successful
Release / pack-and-publish (release) Successful in 36s
This commit is contained in:
@@ -1,39 +1,19 @@
|
||||
using YandexMusic.API.Common;
|
||||
using YandexMusic.API.Models.Common;
|
||||
using YandexMusic.API.Models.Label;
|
||||
using YandexMusic.API.Requests.Label;
|
||||
|
||||
namespace YandexMusic.API;
|
||||
|
||||
public partial class YLabelAPI : YCommonAPI
|
||||
/// <summary>API для работы с лейблами.</summary>
|
||||
public class YLabelAPI : YCommonAPI
|
||||
{
|
||||
public YLabelAPI(YandexMusicApi yandex) : base(yandex)
|
||||
{
|
||||
}
|
||||
public YLabelAPI(YandexMusicApi api) : base(api) { }
|
||||
|
||||
/// <summary>
|
||||
/// Постраничное получение альбомов лейбла
|
||||
/// </summary>
|
||||
/// <param name="storage">Хранилище</param>
|
||||
/// <param name="label">Лейбл</param>
|
||||
/// <param name="page">Страница</param>
|
||||
public Task<YResponse<YLabelAlbums>> GetAlbumsByLabelAsync(AuthStorage storage, YLabel label, int page)
|
||||
{
|
||||
return new YGetLabelAlbumsBuilder(api, storage)
|
||||
.Build((label, page))
|
||||
.GetResponseAsync();
|
||||
}
|
||||
/// <summary>Получает альбомы лейбла с пагинацией.</summary>
|
||||
public Task<YLabelAlbums?> GetAlbumsByLabelAsync(YLabel label, int page = 0)
|
||||
=> new YGetLabelAlbumsBuilder(Api).ExecuteAsync((label, page));
|
||||
|
||||
/// <summary>
|
||||
/// Постраничное получение артистов лейбла
|
||||
/// </summary>
|
||||
/// <param name="storage">Хранилище</param>
|
||||
/// <param name="label">Лейбл</param>
|
||||
/// <param name="page">Страница</param>
|
||||
public Task<YResponse<YLabelArtists>> GetArtistsByLabelAsync(AuthStorage storage, YLabel label, int page)
|
||||
{
|
||||
return new YGetLabelArtistsBuilder(api, storage)
|
||||
.Build((label, page))
|
||||
.GetResponseAsync();
|
||||
}
|
||||
/// <summary>Получает артистов лейбла с пагинацией.</summary>
|
||||
public Task<YLabelArtists?> GetArtistsByLabelAsync(YLabel label, int page = 0)
|
||||
=> new YGetLabelArtistsBuilder(Api).ExecuteAsync((label, page));
|
||||
}
|
||||
Reference in New Issue
Block a user