Fixed GetSavedTracks (Thanks to @whereismyspaceship )

This commit is contained in:
Johnny @PC 2015-02-21 18:16:56 +01:00
parent 3afbea32a6
commit 1f359dfa74
2 changed files with 11 additions and 3 deletions

View File

@ -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; }
}
}

View File

@ -84,12 +84,12 @@ namespace SpotifyAPI.SpotifyWebAPI
JArray array = new JArray(ids.ToArray());
return UploadData<ErrorResponse>("https://api.spotify.com/v1/me/tracks/", array.ToString(Formatting.None), "PUT");
}
public Paging<FullTrack> GetSavedTracks(String market = "")
public Paging<SavedTrack> GetSavedTracks(String market = "")
{
if(market == "")
return DownloadData<Paging<FullTrack>>("https://api.spotify.com/v1/me/tracks");
return DownloadData<Paging<SavedTrack>>("https://api.spotify.com/v1/me/tracks");
else
return DownloadData<Paging<FullTrack>>("https://api.spotify.com/v1/me/tracks?market=" + market);
return DownloadData<Paging<SavedTrack>>("https://api.spotify.com/v1/me/tracks?market=" + market);
}
public ErrorResponse RemoveSavedTracks(List<String> ids)
{