/// <summary> /// Gets a Tuple, containing queries for tracks, users, and playlists. /// Please note that this process can take considerably long. /// </summary> /// <param name="query"></param> /// <param name="limit"></param> /// <returns></returns> public Tuple <TrackQueryObject, UserQueryObject, PlaylistQueryObject> GetAllQuery(string query, int limit) { TrackQueryObject tracks = GetTrackQuery(query, limit); UserQueryObject users = GetUserQuery(query, limit); PlaylistQueryObject playlists = GetPlaylistQuery(query, limit); return(Tuple.Create(tracks, users, playlists)); }
/// <summary> /// Get the next page in a track query. /// </summary> /// <param name="link"></param> /// <returns></returns> public TrackQueryObject GetNextTrackInQuery(string link) { using (Stream s = jsonClient.GetStreamAsync(link).Result) using (StreamReader sr = new StreamReader(s)) using (JsonReader reader = new JsonTextReader(sr)) { JsonSerializer serializer = new JsonSerializer(); TrackQueryObject newTrackObject = serializer.Deserialize <TrackQueryObject>(reader); link = newTrackObject.next_href; return(newTrackObject); } }