diff --git a/YandexMusic.API/Common/Providers/MockRequestProvider.cs b/YandexMusic.API/Common/Providers/MockRequestProvider.cs deleted file mode 100644 index dcd6476..0000000 --- a/YandexMusic.API/Common/Providers/MockRequestProvider.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace YandexMusic.API.Common.Providers -{ - /// - /// Провайдер запросов данными из файла - /// - public class MockRequestProvider : CommonRequestProvider - { - - - public MockRequestProvider(AuthStorage authStorage) : base(authStorage) - { - } - - - - #region IRequestProvider - - public override Task GetWebResponseAsync(HttpRequestMessage message, - HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) - { - throw new NotImplementedException(); - } - - #endregion IRequestProvider - } -} \ No newline at end of file diff --git a/YandexMusic.API/Extensions/API/YPlaylistExtensionsAsync.cs b/YandexMusic.API/Extensions/API/YPlaylistExtensionsAsync.cs index bcfaf5b..c42566b 100644 --- a/YandexMusic.API/Extensions/API/YPlaylistExtensionsAsync.cs +++ b/YandexMusic.API/Extensions/API/YPlaylistExtensionsAsync.cs @@ -8,6 +8,11 @@ namespace YandexMusic.API.Extensions.API; /// public static partial class YPlaylistExtensions { + private static bool CheckUser(YPlaylist playlist) + { + return playlist.Owner.Uid == playlist.Context.Storage.User.Uid; + } + public static async Task WithTracksAsync(this YPlaylist playlist) { return playlist.Tracks != null diff --git a/YandexMusic.API/Requests/Common/YRequest.cs b/YandexMusic.API/Requests/Common/YRequest.cs index 61d741b..6f79a8e 100644 --- a/YandexMusic.API/Requests/Common/YRequest.cs +++ b/YandexMusic.API/Requests/Common/YRequest.cs @@ -5,15 +5,11 @@ namespace YandexMusic.API.Requests.Common; internal class YRequest { - #region Поля - private HttpRequestMessage msg; private IRequestProvider provider; protected YandexMusicApi api; - #endregion Поля - public YRequest(HttpRequestMessage message, YandexMusicApi yandex, AuthStorage auth) { msg = message; diff --git a/YandexMusic.API/YandexMusicApi.cs b/YandexMusic.API/YandexMusicApi.cs index 2428767..43eda6f 100644 --- a/YandexMusic.API/YandexMusicApi.cs +++ b/YandexMusic.API/YandexMusicApi.cs @@ -35,7 +35,19 @@ public class YandexMusicApi /// Создаёт экземпляр API с инициализацией всех подсистем. public YandexMusicApi() { - foreach (var property in GetType().GetProperties()) - property.SetValue(this, Activator.CreateInstance(property.PropertyType, this)); + 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); } } \ No newline at end of file