diff --git a/SpotifyAPI/Local/Models/Track.cs b/SpotifyAPI/Local/Models/Track.cs
index cda2dc3e..de2c4ecb 100644
--- a/SpotifyAPI/Local/Models/Track.cs
+++ b/SpotifyAPI/Local/Models/Track.cs
@@ -75,6 +75,7 @@ namespace SpotifyAPI.Local.Models
}
return "";
}
+
///
/// Returns a Bitmap of the album cover in the provided size asynchronous
///
@@ -95,6 +96,24 @@ namespace SpotifyAPI.Local.Models
}
}
}
+
+ ///
+ /// Returns a byte[] of the the album cover in the provided size asynchronous
+ ///
+ /// AlbumArtSize (160,320,640)
+ /// A byte[], which is the albumart in binary data
+ public async Task GetAlbumArtAsByteArrayAsync(AlbumArtSize size)
+ {
+ using (WebClient wc = new WebClient())
+ {
+ wc.Proxy = null;
+ String url = GetAlbumArtUrl(size);
+ if (url == "")
+ return null;
+ return await wc.DownloadDataTaskAsync(url);
+ }
+ }
+
///
/// Returns a Bitmap of the album cover in the provided size
///
@@ -115,5 +134,22 @@ namespace SpotifyAPI.Local.Models
}
}
}
+
+ ///
+ /// Returns a byte[] of the album cover in the provided size
+ ///
+ /// AlbumArtSize (160,320,640)
+ /// A byte[], which is the albumart in binary data
+ public byte[] GetAlbumArtAsByteArray(AlbumArtSize size)
+ {
+ using (WebClient wc = new WebClient())
+ {
+ wc.Proxy = null;
+ String url = GetAlbumArtUrl(size);
+ if (url == "")
+ return null;
+ return wc.DownloadData(url);
+ }
+ }
}
}