public List <Track> LoadTracks() { Tracks = new List <Track>(); try { string response = CurrentRuntime.ExecuteHttpGet($"/album/{Id}/tracks"); if (string.IsNullOrEmpty(response) == false) { var jsonResult = JsonConvert.DeserializeObject <Dictionary <string, object> >(response); Tracks = JsonConvert.DeserializeObject <List <Track> >(jsonResult["data"].ToString()); foreach (Track track in Tracks) { track.CurrentRuntime = CurrentRuntime; track.Album = this; } } } catch { } TracksCount = Tracks.Count; return(Tracks); }
public async Task <List <Album> > LoadAlbums() { string responseContent = await CurrentRuntime.ExecuteHttpGet(string.Format("/artist/{0}/albums", Id)); var jsonResult = JsonConvert.DeserializeObject <Dictionary <string, object> >(responseContent); Albums = JsonConvert.DeserializeObject <List <Album> >(jsonResult["data"].ToString()); foreach (Album album in Albums) { album.CurrentRuntime = CurrentRuntime; } AlbumsCount = Albums.Count; return(Albums); }
public List <Album> LoadAlbums() { Albums = new List <Album>(); string response = CurrentRuntime.ExecuteHttpGet($"/artist/{Id}/albums"); if (string.IsNullOrEmpty(response) == false) { var jsonResult = JsonConvert.DeserializeObject <Dictionary <string, object> >(response); Albums = JsonConvert.DeserializeObject <List <Album> >(jsonResult["data"].ToString()); foreach (Album album in Albums) { album.CurrentRuntime = CurrentRuntime; album.Artist = this; } AlbumsCount = Albums.Count; } return(Albums); }
public void LoadTracks() { string responseContent = CurrentRuntime.ExecuteHttpGet($"/playlist/{Id}/tracks?limit=1000"); InternalTracks = JsonConvert.DeserializeObject <TracksContainer>(responseContent); }
public async Task LoadTracksAsync() { string responseContent = await CurrentRuntime.ExecuteHttpGet(string.Format("/playlist/{0}/tracks?limit=1000", Id)); InternalTracks = JsonConvert.DeserializeObject <TracksContainer>(responseContent); }