Skip to content

Commit

Permalink
Fix dlrudie#101 incorrect track titles with Spotify
Browse files Browse the repository at this point in the history
Now iterates over all the search returns and makes sure
that the window title contains the song/artist before
using it as the current song.
  • Loading branch information
tterrag1098 committed Aug 18, 2016
1 parent 53191c5 commit 053e2be
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions Snip/Players/Spotify.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,19 @@ public override void Update()
{
jsonSummary = SimpleJson.DeserializeObject(jsonSummary.tracks["items"].ToString());

TextHandler.UpdateText(
jsonSummary[0].name.ToString(),
jsonSummary[0].artists[0].name.ToString(),
jsonSummary[0].album.name.ToString());

if (Globals.SaveAlbumArtwork)
foreach (dynamic song in jsonSummary)
{
this.HandleSpotifyAlbumArtwork(jsonSummary[0].name.ToString());
if (spotifyTitle.Contains(song.name) && spotifyTitle.Contains(song.artists[0].name))
{
TextHandler.UpdateText(song.name.ToString(), song.artists[0].name.ToString(), song.album.name.ToString());

if (Globals.SaveAlbumArtwork)
{
this.HandleSpotifyAlbumArtwork(song.name.ToString());
}

break;
}
}
}
else
Expand Down

0 comments on commit 053e2be

Please sign in to comment.