From 1dc4248d84e61e49a786ed14767c900effdf29a1 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Sat, 2 Apr 2016 00:06:31 -0600 Subject: [PATCH 1/2] fixed parsing of html to get the proper album art id --- SpotifyAPI/Local/Models/Track.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) mode change 100644 => 100755 SpotifyAPI/Local/Models/Track.cs diff --git a/SpotifyAPI/Local/Models/Track.cs b/SpotifyAPI/Local/Models/Track.cs old mode 100644 new mode 100755 index f8f03206f..9ff6315ba --- a/SpotifyAPI/Local/Models/Track.cs +++ b/SpotifyAPI/Local/Models/Track.cs @@ -46,7 +46,7 @@ public bool IsAd() public string GetAlbumArtUrl(AlbumArtSize size) { if (AlbumResource.Uri == null || !AlbumResource.Uri.Contains("spotify:album:") || AlbumResource.Uri.Contains("spotify:album:0000000000000000000000")) - return ""; + return "testing"; int albumsize = 0; switch (size) @@ -70,12 +70,20 @@ public string GetAlbumArtUrl(AlbumArtSize size) raw = wc.DownloadString("http://open.spotify.com/album/" + AlbumResource.Uri.Split(new[] { ":" }, StringSplitOptions.None)[2]); } raw = raw.Replace("\t", ""); + + // < meta property = "og:image" content = "http://o.scdn.co/cover/12b318ffe0e4c92f9b4e1486e4726a57e6437ca7" > + // Spotify changed the response so I am now getting the substring from the first line that parses out the above tag. string[] lines = raw.Split(new[] { "\n" }, StringSplitOptions.None); + string startString = ""; foreach (string line in lines) { - if (line.Trim().StartsWith("", ""); } } From 809f2f91af8df10fd97b2dabea8c3ddf1fc1f43c Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Sat, 2 Apr 2016 00:11:30 -0600 Subject: [PATCH 2/2] removed testing string from return --- SpotifyAPI/Local/Models/Track.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SpotifyAPI/Local/Models/Track.cs b/SpotifyAPI/Local/Models/Track.cs index 9ff6315ba..10b1f3bfd 100755 --- a/SpotifyAPI/Local/Models/Track.cs +++ b/SpotifyAPI/Local/Models/Track.cs @@ -46,7 +46,7 @@ public bool IsAd() public string GetAlbumArtUrl(AlbumArtSize size) { if (AlbumResource.Uri == null || !AlbumResource.Uri.Contains("spotify:album:") || AlbumResource.Uri.Contains("spotify:album:0000000000000000000000")) - return "testing"; + return ""; int albumsize = 0; switch (size)