From e511048c287410b772065fe2f55103ed738e3450 Mon Sep 17 00:00:00 2001 From: Alessandro Attard Barbini <11708634+aleab@users.noreply.github.com> Date: Sun, 30 Sep 2018 19:27:39 +0200 Subject: [PATCH] Added missing currently_playing_type field to PlaybackContext --- SpotifyAPI.Web/Enums/TrackType.cs | 20 ++++++++++++++++++++ SpotifyAPI.Web/Models/PlaybackContext.cs | 4 ++++ 2 files changed, 24 insertions(+) create mode 100644 SpotifyAPI.Web/Enums/TrackType.cs diff --git a/SpotifyAPI.Web/Enums/TrackType.cs b/SpotifyAPI.Web/Enums/TrackType.cs new file mode 100644 index 000000000..63c43419a --- /dev/null +++ b/SpotifyAPI.Web/Enums/TrackType.cs @@ -0,0 +1,20 @@ +using System; + +namespace SpotifyAPI.Web.Enums +{ + [Flags] + public enum TrackType + { + [String("track")] + Track = 1, + + [String("episode")] + Episode = 2, + + [String("ad")] + Ad = 4, + + [String("unknown")] + Unknown = 8 + } +} \ No newline at end of file diff --git a/SpotifyAPI.Web/Models/PlaybackContext.cs b/SpotifyAPI.Web/Models/PlaybackContext.cs index d89926b82..dabec3002 100644 --- a/SpotifyAPI.Web/Models/PlaybackContext.cs +++ b/SpotifyAPI.Web/Models/PlaybackContext.cs @@ -31,5 +31,9 @@ public class PlaybackContext : BasicModel [JsonProperty("item")] public FullTrack Item { get; set; } + + [JsonProperty("currently_playing_type")] + [JsonConverter(typeof(StringEnumConverter))] + public TrackType CurrentlyPlayingType { get; set; } } } \ No newline at end of file