From 50da85be57c6d89b75c3303d6988265f97486f15 Mon Sep 17 00:00:00 2001 From: FrigaT Date: Tue, 14 Apr 2026 02:44:57 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=D1=8B=20=D0=BB?= =?UTF-8?q?=D0=B8=D1=88=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81?= =?UTF-8?q?=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/Providers/MockRequestProvider.cs | 26 ------------------- .../API/YPlaylistExtensionsAsync.cs | 5 ++++ YandexMusic.API/Requests/Common/YRequest.cs | 4 --- YandexMusic.API/YandexMusicApi.cs | 16 ++++++++++-- 4 files changed, 19 insertions(+), 32 deletions(-) delete mode 100644 YandexMusic.API/Common/Providers/MockRequestProvider.cs 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