From ead9bf4ed95fea8c99a7439f9c0bad1ec9486524 Mon Sep 17 00:00:00 2001 From: SKProCH Date: Tue, 16 Jan 2024 01:51:47 +0300 Subject: [PATCH] Replace ids to YandexId is some internal classes to fix serialization --- YandexMusicResolver/AudioItems/YandexMusicArtist.cs | 8 ++++++-- .../Responses/MetaPlaylistTrackContainer.cs | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/YandexMusicResolver/AudioItems/YandexMusicArtist.cs b/YandexMusicResolver/AudioItems/YandexMusicArtist.cs index d620650..2cb96fd 100644 --- a/YandexMusicResolver/AudioItems/YandexMusicArtist.cs +++ b/YandexMusicResolver/AudioItems/YandexMusicArtist.cs @@ -1,4 +1,7 @@ -namespace YandexMusicResolver.AudioItems { +using System.Text.Json.Serialization; +using YandexMusicResolver.Ids; + +namespace YandexMusicResolver.AudioItems { /// /// Represent a artist in Yandex Music /// @@ -6,7 +9,8 @@ public class YandexMusicArtist { /// /// Artist ID /// - public long Id { get; set; } + [JsonConverter(typeof(YandexIdConverter))] + public YandexId Id { get; set; } /// /// Artist name diff --git a/YandexMusicResolver/Responses/MetaPlaylistTrackContainer.cs b/YandexMusicResolver/Responses/MetaPlaylistTrackContainer.cs index 2da23c0..da66af7 100644 --- a/YandexMusicResolver/Responses/MetaPlaylistTrackContainer.cs +++ b/YandexMusicResolver/Responses/MetaPlaylistTrackContainer.cs @@ -1,6 +1,10 @@ -namespace YandexMusicResolver.Responses { +using System.Text.Json.Serialization; +using YandexMusicResolver.Ids; + +namespace YandexMusicResolver.Responses { internal class MetaPlaylistTrackContainer { - public long Id { get; set; } + [JsonConverter(typeof(YandexIdConverter))] + public YandexId Id { get; set; } public MetaTrack? Track { get; set; } }