Skip to content

Commit

Permalink
Album Artwork Fix
Browse files Browse the repository at this point in the history
This fixes artwork links not working with Spotify's new API.
  • Loading branch information
David Rudie committed Jan 21, 2016
1 parent bf5d048 commit 32913ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Snip/Players/Spotify.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ private void DownloadJson(string spotifyTitle)
}
}

// TODO: Re-write this to download the artwork link supplied in the primary JSON file instead of using the old embedded web link.
private void HandleSpotifyAlbumArtwork(string songTitle)
{
string albumId = string.Empty;
Expand All @@ -213,7 +214,7 @@ private void HandleSpotifyAlbumArtwork(string songTitle)

if (jsonSummary != null)
{
jsonSummary = SimpleJson.DeserializeObject(jsonSummary["tracks"].ToString());
jsonSummary = SimpleJson.DeserializeObject(jsonSummary.tracks["items"].ToString());

foreach (dynamic jsonTrack in jsonSummary)
{
Expand All @@ -223,7 +224,7 @@ private void HandleSpotifyAlbumArtwork(string songTitle)
if (foundTitle == modifiedTitle)
{
dynamic jsonAlbum = SimpleJson.DeserializeObject(jsonTrack["album"].ToString());
albumId = jsonAlbum.href.ToString();
albumId = jsonAlbum.uri.ToString();

break;
}
Expand Down

0 comments on commit 32913ba

Please sign in to comment.