Убраны лишние классы
This commit is contained in:
@@ -1,26 +0,0 @@
|
|||||||
namespace YandexMusic.API.Common.Providers
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Провайдер запросов данными из файла
|
|
||||||
/// </summary>
|
|
||||||
public class MockRequestProvider : CommonRequestProvider
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
public MockRequestProvider(AuthStorage authStorage) : base(authStorage)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region IRequestProvider
|
|
||||||
|
|
||||||
public override Task<HttpResponseMessage> GetWebResponseAsync(HttpRequestMessage message,
|
|
||||||
HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion IRequestProvider
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -8,6 +8,11 @@ namespace YandexMusic.API.Extensions.API;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static partial class YPlaylistExtensions
|
public static partial class YPlaylistExtensions
|
||||||
{
|
{
|
||||||
|
private static bool CheckUser(YPlaylist playlist)
|
||||||
|
{
|
||||||
|
return playlist.Owner.Uid == playlist.Context.Storage.User.Uid;
|
||||||
|
}
|
||||||
|
|
||||||
public static async Task<YPlaylist> WithTracksAsync(this YPlaylist playlist)
|
public static async Task<YPlaylist> WithTracksAsync(this YPlaylist playlist)
|
||||||
{
|
{
|
||||||
return playlist.Tracks != null
|
return playlist.Tracks != null
|
||||||
|
|||||||
@@ -5,15 +5,11 @@ namespace YandexMusic.API.Requests.Common;
|
|||||||
|
|
||||||
internal class YRequest<T>
|
internal class YRequest<T>
|
||||||
{
|
{
|
||||||
#region Поля
|
|
||||||
|
|
||||||
private HttpRequestMessage msg;
|
private HttpRequestMessage msg;
|
||||||
private IRequestProvider provider;
|
private IRequestProvider provider;
|
||||||
|
|
||||||
protected YandexMusicApi api;
|
protected YandexMusicApi api;
|
||||||
|
|
||||||
#endregion Поля
|
|
||||||
|
|
||||||
public YRequest(HttpRequestMessage message, YandexMusicApi yandex, AuthStorage auth)
|
public YRequest(HttpRequestMessage message, YandexMusicApi yandex, AuthStorage auth)
|
||||||
{
|
{
|
||||||
msg = message;
|
msg = message;
|
||||||
|
|||||||
@@ -35,7 +35,19 @@ public class YandexMusicApi
|
|||||||
/// <summary>Создаёт экземпляр API с инициализацией всех подсистем.</summary>
|
/// <summary>Создаёт экземпляр API с инициализацией всех подсистем.</summary>
|
||||||
public YandexMusicApi()
|
public YandexMusicApi()
|
||||||
{
|
{
|
||||||
foreach (var property in GetType().GetProperties())
|
Album = new YAlbumAPI(this);
|
||||||
property.SetValue(this, Activator.CreateInstance(property.PropertyType, 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user