Полный рефакторинг api. Вынесено отдельно api passport

This commit is contained in:
2026-04-20 23:30:01 +03:00
parent 34261d02a9
commit eb1eba0162
61 changed files with 1074 additions and 640 deletions

View File

@@ -6,9 +6,9 @@ namespace YandexMusic.API;
public class YandexMusicApi
{
/// <summary>HttpClient, используемый для всех запросов.</summary>
public HttpClient HttpClient { get; }
internal HttpClient HttpClient { get; }
/// <summary>Хранилище данных авторизации.</summary>
public AuthStorage Storage { get; }
internal AuthStorage Storage { get; }
/// <summary>API для работы с альбомами.</summary>
public YAlbumAPI Album { get; internal set; } = null!;
@@ -33,11 +33,13 @@ public class YandexMusicApi
/// <summary>API для работы с очередями.</summary>
public YQueueAPI Queue { get; internal set; } = null!;
/// <summary>API для работы с пользователем и авторизацией.</summary>
public YUserAPI User { get; internal set; } = null!;
public YAuthAPI Auth { get; internal set; } = null!;
/// <summary>API для загрузки пользовательского контента.</summary>
public YUgcAPI UserGeneratedContent { get; internal set; } = null!;
/// <summary>API для работы с протоколом Ynison (WebSocket).</summary>
public YYnisonAPI Ynison { get; internal set; } = null!;
/// <summary>API для работы с яндекс пасспорт.</summary>
public YPassportAPI Passport { get; internal set; } = null!;
/// <summary>
/// Инициализирует новый экземпляр API.
@@ -49,19 +51,20 @@ public class YandexMusicApi
HttpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
Storage = storage ?? throw new ArgumentNullException(nameof(storage));
Album = new YAlbumAPI(this);
Artist = new YArtistAPI(this);
Label = new YLabelAPI(this);
Landing = new YLandingAPI(this);
Library = new YLibraryAPI(this);
Playlist = new YPlaylistAPI(this);
Pins = new YPinsAPI(this);
Radio = new YRadioAPI(this);
Search = new YSearchAPI(this);
Track = new YTrackAPI(this);
Queue = new YQueueAPI(this);
User = new YUserAPI(this);
UserGeneratedContent = new YUgcAPI(this);
Ynison = new YYnisonAPI(this);
Album = new(this);
Artist = new(this);
Label = new(this);
Landing = new(this);
Library = new(this);
Playlist = new(this);
Pins = new(this);
Radio = new(this);
Search = new(this);
Track = new(this);
Queue = new(this);
Auth = new(this);
UserGeneratedContent = new(this);
Ynison = new(this);
Passport = new(this);
}
}