Полностью переписанное 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,21 +1,16 @@
|
||||
using YandexMusic.API.Common;
|
||||
using YandexMusic.API.Common.Ynison;
|
||||
|
||||
namespace YandexMusic.API;
|
||||
/// <summary>
|
||||
/// API Ynison
|
||||
/// </summary>
|
||||
public partial class YYnisonAPI : YCommonAPI
|
||||
|
||||
/// <summary>API для работы с Ynison (WebSocket-плеер).</summary>
|
||||
public class YYnisonAPI : YCommonAPI
|
||||
{
|
||||
public YYnisonAPI(YandexMusicApi yandex) : base(yandex)
|
||||
{
|
||||
}
|
||||
public YYnisonAPI(YandexMusicApi api) : base(api) { }
|
||||
|
||||
public YnisonPlayer GetPlayer(AuthStorage storage)
|
||||
public YnisonPlayer GetPlayer()
|
||||
{
|
||||
if (string.IsNullOrEmpty(storage.Token))
|
||||
throw new Exception("Токен пользователя не задан.");
|
||||
|
||||
return new(api, storage);
|
||||
if (string.IsNullOrEmpty(Api.Storage.Token))
|
||||
throw new Exception("Токен пользователя не задан");
|
||||
return new YnisonPlayer(Api, Api.Storage);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user