Убрал синхронность
This commit is contained in:
@@ -1,24 +0,0 @@
|
|||||||
using YandexMusic.API.Models.Album;
|
|
||||||
|
|
||||||
namespace YandexMusic.API.Extensions.API;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Методы-расширения для альбома
|
|
||||||
/// </summary>
|
|
||||||
public static partial class YAlbumExtensions
|
|
||||||
{
|
|
||||||
public static YAlbum WithTracks(this YAlbum album)
|
|
||||||
{
|
|
||||||
return WithTracksAsync(album).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string AddLike(this YAlbum album)
|
|
||||||
{
|
|
||||||
return AddLikeAsync(album).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string RemoveLike(this YAlbum album)
|
|
||||||
{
|
|
||||||
return RemoveLikeAsync(album).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
using YandexMusic.API.Models.Artist;
|
|
||||||
using YandexMusic.API.Models.Track;
|
|
||||||
|
|
||||||
namespace YandexMusic.API.Extensions.API;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Методы-расширения для исполнителя
|
|
||||||
/// </summary>
|
|
||||||
public static partial class YArtistExtensions
|
|
||||||
{
|
|
||||||
public static YArtistBriefInfo BriefInfo(this YArtist artist)
|
|
||||||
{
|
|
||||||
return BriefInfoAsync(artist).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static YTracksPage GetTracks(this YArtist artist, int page = 0, int pageSize = 20)
|
|
||||||
{
|
|
||||||
return GetTracksAsync(artist, page, pageSize).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<YTrack> GetAllTracks(this YArtist artist)
|
|
||||||
{
|
|
||||||
return GetAllTracksAsync(artist).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string AddLike(this YArtist artist)
|
|
||||||
{
|
|
||||||
return AddLikeAsync(artist).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string RemoveLike(this YArtist artist)
|
|
||||||
{
|
|
||||||
return RemoveLikeAsync(artist).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
using YandexMusic.API.Models.Playlist;
|
|
||||||
using YandexMusic.API.Models.Track;
|
|
||||||
|
|
||||||
namespace YandexMusic.API.Extensions.API;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Методы-расширения для плейлиста
|
|
||||||
/// </summary>
|
|
||||||
public static partial class YPlaylistExtensions
|
|
||||||
{
|
|
||||||
private static bool CheckUser(YPlaylist playlist)
|
|
||||||
{
|
|
||||||
return playlist.Owner.Uid == playlist.Context.Storage.User.Uid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static YPlaylist WithTracks(this YPlaylist playlist)
|
|
||||||
{
|
|
||||||
return WithTracksAsync(playlist).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string AddLike(this YPlaylist playlist)
|
|
||||||
{
|
|
||||||
return AddLikeAsync(playlist).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string RemoveLike(this YPlaylist playlist)
|
|
||||||
{
|
|
||||||
return RemoveLikeAsync(playlist).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static YPlaylist Rename(this YPlaylist playlist, string newName)
|
|
||||||
{
|
|
||||||
return RenameAsync(playlist, newName).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool Delete(this YPlaylist playlist)
|
|
||||||
{
|
|
||||||
return DeleteAsync(playlist).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static YPlaylist InsertTracks(this YPlaylist playlist, params YTrack[] tracks)
|
|
||||||
{
|
|
||||||
return InsertTracksAsync(playlist, tracks).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static YPlaylist RemoveTracks(this YPlaylist playlist, params YTrack[] tracks)
|
|
||||||
{
|
|
||||||
return RemoveTracksAsync(playlist, tracks).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool UploadTracks(this YPlaylist playlist, string filePath, string fileName)
|
|
||||||
{
|
|
||||||
return UploadTracksAsync(playlist, filePath, fileName).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
using YandexMusic.API.Models.Radio;
|
|
||||||
using YandexMusic.API.Models.Track;
|
|
||||||
|
|
||||||
namespace YandexMusic.API.Extensions.API;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Методы-расширения для радиостанции
|
|
||||||
/// </summary>
|
|
||||||
public static partial class YStationResultExtensions
|
|
||||||
{
|
|
||||||
public static List<YSequenceItem> GetTracks(this YStation station, string prevTrackId = "")
|
|
||||||
{
|
|
||||||
return GetTracksAsync(station, prevTrackId).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string SetSettings2(this YStation station, YStationSettings2 settings)
|
|
||||||
{
|
|
||||||
return SetSettings2Async(station, settings).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string SendFeedBack(this YStation station, YStationFeedbackType type, YTrack track = null, string batchId = "", double totalPlayedSeconds = 0)
|
|
||||||
{
|
|
||||||
return SendFeedBackAsync(station, type, track, batchId, totalPlayedSeconds).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
using YandexMusic.API.Models.Track;
|
|
||||||
|
|
||||||
namespace YandexMusic.API.Extensions.API;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Методы-расширения для трека
|
|
||||||
/// </summary>
|
|
||||||
public static partial class YTrackExtensions
|
|
||||||
{
|
|
||||||
public static string GetLink(this YTrack track)
|
|
||||||
{
|
|
||||||
return GetLinkAsync(track).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Save(this YTrack track, string filePath)
|
|
||||||
{
|
|
||||||
SaveAsync(track, filePath).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int AddLike(this YTrack track)
|
|
||||||
{
|
|
||||||
return AddLikeAsync(track).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int RemoveLike(this YTrack track)
|
|
||||||
{
|
|
||||||
return RemoveLikeAsync(track).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int AddDislike(this YTrack track)
|
|
||||||
{
|
|
||||||
return AddDislikeAsync(track).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int RemoveDislike(this YTrack track)
|
|
||||||
{
|
|
||||||
return RemoveDislikeAsync(track).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string SendPlayTrackInfo(this YTrack track, string from, bool fromCache = false, string playId = "", string playlistId = "", double totalPlayedSeconds = 0, double endPositionSeconds = 0)
|
|
||||||
{
|
|
||||||
return SendPlayTrackInfoAsync(track, from, fromCache, playId, playlistId, totalPlayedSeconds).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static YTrackSupplement Supplement(this YTrack track)
|
|
||||||
{
|
|
||||||
return SupplementAsync(track).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static YTrackSimilar Similar(this YTrack track)
|
|
||||||
{
|
|
||||||
return SimilarAsync(track).GetAwaiter().GetResult();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user