From 1f359dfa740e78f3fe35ddfd0b4ba6a3ba3cfc56 Mon Sep 17 00:00:00 2001 From: "Johnny @PC" Date: Sat, 21 Feb 2015 18:16:56 +0100 Subject: [PATCH] Fixed GetSavedTracks (Thanks to @whereismyspaceship ) --- SpotifyAPI/SpotifyWebAPI/Models/GeneralModels.cs | 8 ++++++++ SpotifyAPI/SpotifyWebAPI/SpotifyWebAPIClass.cs | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/SpotifyAPI/SpotifyWebAPI/Models/GeneralModels.cs b/SpotifyAPI/SpotifyWebAPI/Models/GeneralModels.cs index cc9db476..21472499 100644 --- a/SpotifyAPI/SpotifyWebAPI/Models/GeneralModels.cs +++ b/SpotifyAPI/SpotifyWebAPI/Models/GeneralModels.cs @@ -113,4 +113,12 @@ namespace SpotifyAPI.SpotifyWebAPI.Models [JsonProperty("uri")] public String Uri { get; set; } } + + public class SavedTrack + { + [JsonProperty("added_at")] + public DateTime AddedAt { get; set; } + [JsonProperty("track")] + public FullTrack Track { get; set; } + } } diff --git a/SpotifyAPI/SpotifyWebAPI/SpotifyWebAPIClass.cs b/SpotifyAPI/SpotifyWebAPI/SpotifyWebAPIClass.cs index 118e33bc..c0d7f43f 100644 --- a/SpotifyAPI/SpotifyWebAPI/SpotifyWebAPIClass.cs +++ b/SpotifyAPI/SpotifyWebAPI/SpotifyWebAPIClass.cs @@ -84,12 +84,12 @@ namespace SpotifyAPI.SpotifyWebAPI JArray array = new JArray(ids.ToArray()); return UploadData("https://api.spotify.com/v1/me/tracks/", array.ToString(Formatting.None), "PUT"); } - public Paging GetSavedTracks(String market = "") + public Paging GetSavedTracks(String market = "") { if(market == "") - return DownloadData>("https://api.spotify.com/v1/me/tracks"); + return DownloadData>("https://api.spotify.com/v1/me/tracks"); else - return DownloadData>("https://api.spotify.com/v1/me/tracks?market=" + market); + return DownloadData>("https://api.spotify.com/v1/me/tracks?market=" + market); } public ErrorResponse RemoveSavedTracks(List ids) {