Example #1
0
        /// <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));
        }
Example #2
0
        /// <summary>
        /// Get the next page in a playlist query.
        /// </summary>
        /// <param name="link"></param>
        /// <returns></returns>
        public PlaylistQueryObject GetNextPlaylistInQuery(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();
                        PlaylistQueryObject newPlaylistObject = serializer.Deserialize <PlaylistQueryObject>(reader);
                        link = newPlaylistObject.next_href;

                        return(newPlaylistObject);
                    }
        }