обновление json parse
All checks were successful
Release / pack-and-publish (release) Successful in 45s
All checks were successful
Release / pack-and-publish (release) Successful in 45s
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using YandexMusic.API.Converters;
|
||||
using YandexMusic.API.Models.Common;
|
||||
|
||||
namespace YandexMusic.API.Models.Account;
|
||||
@@ -36,5 +37,6 @@ public class YAccount
|
||||
|
||||
public bool ServiceAvailable { get; set; }
|
||||
|
||||
[JsonConverter(typeof(IntToStringConverter))]
|
||||
public string Uid { get; set; }
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class YCoverConverter : JsonConverter<YCover>
|
||||
"from-artist-photos" or "from-album-cover" => JsonSerializer.Deserialize<YCoverImage>(root.GetRawText(), options),
|
||||
"pic" => JsonSerializer.Deserialize<YCoverPic>(root.GetRawText(), options),
|
||||
"mosaic" => JsonSerializer.Deserialize<YCoverMosaic>(root.GetRawText(), options),
|
||||
_ => JsonSerializer.Deserialize<YCover>(root.GetRawText(), options)
|
||||
_ => new YCover() { Type = YCoverType.Error }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace YandexMusic.API.Models.Common.Cover;
|
||||
@@ -8,9 +7,7 @@ public enum YCoverType
|
||||
{
|
||||
Color,
|
||||
Error,
|
||||
[EnumMember(Value = "from-artist-photos")]
|
||||
FromArtistPhotos,
|
||||
[EnumMember(Value = "from-album-cover")]
|
||||
FromAlbumCover,
|
||||
Mosaic,
|
||||
Pic,
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace YandexMusic.API.Models.Common;
|
||||
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public enum YTrackSharingFlag
|
||||
{
|
||||
[EnumMember(Value = "VIDEO_ALLOWED")]
|
||||
[JsonStringEnumMemberName("VIDEO_ALLOWED")]
|
||||
VideoAllowed,
|
||||
[EnumMember(Value = "COVER_ONLY")]
|
||||
[JsonStringEnumMemberName("COVER_ONLY")]
|
||||
CoverOnly
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using YandexMusic.API.Converters;
|
||||
using YandexMusic.API.Models.Common;
|
||||
using YandexMusic.API.Models.Common.Cover;
|
||||
using YandexMusic.API.Models.Track;
|
||||
@@ -44,6 +45,7 @@ public class YPlaylist : YBaseModel
|
||||
public string Image { get; set; }
|
||||
public bool IsBanner { get; set; }
|
||||
public bool IsPremiere { get; set; }
|
||||
[JsonConverter(typeof(IntToStringConverter))]
|
||||
public string Kind { get; set; }
|
||||
public List<YPlaylist> LastOwnerPlaylists { get; set; }
|
||||
public int LikesCount { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user