/// <summary> /// Helper method to retrieve a stream with an artists picture /// </summary> public WebStreamModel GetArtistPicture(String picture, Int32 artistId, ArtistPictureSize size) { var w = 750; var h = 500; if (!RestUtility.ParseImageSize(size.ToString(), out w, out h)) throw new ArgumentException("Invalid image size", "size"); String url = null; if (!String.IsNullOrEmpty(picture)) url = String.Format("http://resources.wimpmusic.com/images/{0}/{1}x{2}.jpg", picture.Replace('-', '/'), w, h); else url = String.Format("http://images.tidalhifi.com/im/im?w={1}&h={2}&artistid={0}&noph", artistId, w, h); return new WebStreamModel(RestClient.GetWebResponse(url)); }
/// <summary> /// Helper method to retrieve a stream with an artists picture /// </summary> public Stream GetArtistPicture(String picture, Int32 artistId, ArtistPictureSize size) { var w = 750; var h = 500; if (!RestUtility.ParseImageSize(size.ToString(), out w, out h)) { throw new ArgumentException("Invalid image size", "size"); } String url = null; if (!String.IsNullOrEmpty(picture)) { url = String.Format("http://resources.wimpmusic.com/images/{0}/{1}x{2}.jpg", picture.Replace('-', '/'), w, h); } else { url = String.Format("http://images.tidalhifi.com/im/im?w={1}&h={2}&artistid={0}&noph", artistId, w, h); } return(RestClient.GetStream(url)); }
public static string GetArtistPictureUrl(String picture, Int32 artistId, ArtistPictureSize size) { int w = 750; int h = 500; if (!RestUtility.ParseImageSize(size.ToString(), out w, out h)) { throw new ArgumentException("Invalid image size", "size"); } String url = null; if (!String.IsNullOrEmpty(picture)) { url = GetImageUrl(picture, w, h); } else { url = String.Format("http://images.tidalhifi.com/im/im?w={1}&h={2}&artistid={0}&noph", artistId, w, h); } return(url); }
/// <summary> /// Helper method to retrieve a stream with an artists picture /// </summary> public Task <WebStreamModel> GetArtistPictureAsync(String picture, Int32 artistId, ArtistPictureSize size) { string url = GetArtistPictureUrl(picture, artistId, size); return(RestClient.GetWebStreamModelAsync(url)); }
/// <summary> /// Helper method to retrieve a stream with an artists picture /// </summary> public Task <WebStreamModel> GetArtistPictureAsync(ArtistModel model, ArtistPictureSize size) { return(GetArtistPictureAsync(model.Picture, model.Id, size)); }
/// <summary> /// Helper method to retrieve a stream with an artists picture /// </summary> public Stream GetArtistPicture(ArtistModel model, ArtistPictureSize size) { return(GetArtistPicture(model.Picture, model.Id, size)); }
/// <summary> /// Helper method to retrieve a stream with an artists picture /// </summary> public WebStreamModel GetArtistPicture(ArtistModel model, ArtistPictureSize size) { return GetArtistPicture(model.Picture, model.Id, size); }