Skip to content

Commit

Permalink
Обновлены модели, исправлено получение пользовательских списков.
Browse files Browse the repository at this point in the history
  • Loading branch information
K1llMan committed Dec 11, 2021
1 parent 65ab892 commit c3e66eb
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Yandex.Music.Api/API/YPlaylistAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ private async Task<YResponse<YPlaylist>> GetPersonalPlaylist(AuthStorage storage
.ContinueWith(list =>
{
YPlaylist playlist = list.GetAwaiter().GetResult().Result.Blocks
.FirstOrDefault(b => b.Type == "personal-playlists")
?.Entities
.Where(b => b.Type == "personal-playlists")
.SelectMany(b => b.Entities)
.FirstOrDefault(e => e.Data.Type == type)
?.Data
.Data;
Expand Down Expand Up @@ -247,7 +247,7 @@ public YResponse<YPlaylist> Podcasts(AuthStorage storage)
/// <returns></returns>
public async Task<YResponse<YPlaylist>> RewindAsync(AuthStorage storage)
{
return await GetPersonalPlaylist(storage, YGeneratedPlaylistType.Rewind20);
return await GetPersonalPlaylist(storage, YGeneratedPlaylistType.Rewind21);
}

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions Yandex.Music.Api/Models/Account/YAccountResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class YAccountResult

public YAccount Account { get; set; }
public string DefaultEmail { get; set; }
public YMasterHub MasterHub { get; set; }
public YPermissions Permissions { get; set; }
public YPlus Plus { get; set; }
public bool PretrialActive { get; set; }
Expand Down
4 changes: 3 additions & 1 deletion Yandex.Music.Api/Models/Account/YBar.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Yandex.Music.Api.Models.Account
using Yandex.Music.Api.Models.Common;

namespace Yandex.Music.Api.Models.Account
{
public class YBar
{
Expand Down
1 change: 1 addition & 0 deletions Yandex.Music.Api/Models/Album/YAlbum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Yandex.Music.Api.Models.Album
{
public class YAlbum : YBaseModel
{
public YButton ActionButton { get; set; }
public List<YArtist> Artists { get; set; }
public bool Available { get; set; }
public bool AvailableForMobile { get; set; }
Expand Down
1 change: 1 addition & 0 deletions Yandex.Music.Api/Models/Artist/YArtist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Yandex.Music.Api.Models.Artist
{
public class YArtist : YBaseModel
{
public YButton ActionButton { get; set; }
public bool Available { get; set; }
public bool Composer { get; set; }
public List<string> Countries { get; set; }
Expand Down
1 change: 1 addition & 0 deletions Yandex.Music.Api/Models/Artist/YArtistBriefInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace Yandex.Music.Api.Models.Artist
{
public class YArtistBriefInfo
{
public YButton ActionButton { get; set; }
public List<YAlbum> Albums { get; set; }
[JsonProperty(ItemConverterType = typeof(YCoverConverter))]
public List<YCover> AllCovers { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
namespace Yandex.Music.Api.Models.Account
namespace Yandex.Music.Api.Models.Common
{
public class YButton
{
public string Text { get; set; }
public string BgColor { get; set; }
public string TextColor { get; set; }
public string Uri { get; set; }
public string Url { get; set; }
public string Color { get; set; }
}
}
8 changes: 8 additions & 0 deletions Yandex.Music.Api/Models/Common/YMasterHub.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Yandex.Music.Api.Models.Common
{
public class YMasterHub
{
public YSubscription[] ActiveSubscriptions { get; set; }
public YSubscription[] AvailableSubscriptions { get; set; }
}
}
1 change: 1 addition & 0 deletions Yandex.Music.Api/Models/Landing/YLandingBlockEntityData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class YLandingBlockEntityData
public YPlaylist Data { get; set; }
public List<string> Description { get; set; }
public bool Notify { get; set; }
public string PreviewDescription { get; set; }
public bool Ready { get; set; }
public YGeneratedPlaylistType Type { get; set; }

Expand Down
7 changes: 6 additions & 1 deletion Yandex.Music.Api/Models/Playlist/YGeneratedPlaylistType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ public enum YGeneratedPlaylistType
{
None,

/// <summary>
/// Редакторский список
/// </summary>
Editorial,

/// <summary>
/// Плейлист дня
/// </summary>
Expand Down Expand Up @@ -37,6 +42,6 @@ public enum YGeneratedPlaylistType
/// <summary>
/// Большая перемотка
/// </summary>
Rewind20,
Rewind21,
}
}
1 change: 1 addition & 0 deletions Yandex.Music.Api/Models/Playlist/YPlaylist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public YPlaylistUidPair GetKey()

#region Ñâîéñòâà

public YButton ActionButton { get; set; }
public string AnimatedCoverUri { get; set; }
public bool Available { get; set; }
public string BackgroundColor { get; set; }
Expand Down
5 changes: 3 additions & 2 deletions Yandex.Music.Api/Models/Playlist/YPlaylistPlayCounter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ public class YPlaylistPlayCounter
#region Ñâîéñòâà

public string Description { get; set; }
public bool? Updated { get; set; }
public int? Value { get; set; }
public string DescriptionNext { get; set; }
public bool Updated { get; set; }
public int?Value { get; set; }

#endregion
}
Expand Down
1 change: 1 addition & 0 deletions Yandex.Music.Api/Models/Radio/YStation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace Yandex.Music.Api.Models.Radio
public class YStation : YBaseModel
{
public YAdParams AdParams { get; set; }
public string CustomName { get; set; }
public YStationData Data { get; set; }
public string Explanation { get; set; }
public List<YPrerolls> Prerolls { get; set; }
Expand Down
2 changes: 2 additions & 0 deletions Yandex.Music.Api/Models/Track/YTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ public YTrackAlbumPair GetKey()
public YTrackNormalization Normalization { get; set; }
public YTrackNormalizationR128 R128 { get; set; }
public string OgImage { get; set; }
public string PlayerId { get; set; }
public long PreviewDurationMs { get; set; }
public YPodcastEpisodeType PodcastEpisodeType { get; set; }
public DateTime PubDate { get; set; }
public string RealId { get; set; }
public bool RememberPosition { get; set; }
public string ShortDescription { get; set; }
Expand Down

0 comments on commit c3e66eb

Please sign in to comment.