public SCTrack[] GetTracks(SCExploreCategory category, int offset = 0, int limit = 10)
        {
            paginationValidator.Validate(offset, limit);

            var parameters = new Dictionary<string, object>();

            var tracks = soundCloudRawClient.Request<ExploreTrackList>(prefix, category.Name, HttpMethod.Get, parameters: parameters.SetPagination(offset, limit), domain: Internal.Client.Helpers.Domain.ApiV2, responseType: string.Empty);
            return tracks.Tracks.Select(trackConverter.Convert).ToArray();
        }
        public SCGroup[] Search(string query, int offset = 0, int limit = 50)
        {
            paginationValidator.Validate(offset, limit);

            var parameters = new Dictionary<string, object>();
            if (!string.IsNullOrEmpty(query))
            {
                parameters.Add("q", query);
            }

            var groups = soundCloudRawClient.Request<Group[]>(prefix, string.Empty, HttpMethod.Get, parameters.SetPagination(offset, limit));
            return groups.Select(groupConverter.Convert).ToArray();
        }
Example #3
0
        public SCTrack[] GetTracks(SCExploreCategory category, int offset = 0, int limit = 10)
        {
            paginationValidator.Validate(offset, limit);

            var parameters = new Dictionary<string, object>();
            parameters.Add("kind", "top");

            //Build genre paramter
            var processed = (category == null || category.Name == "Popular+Music") ? "all-music" : new String(System.Uri.UnescapeDataString(category.Name).Where(ch => Char.IsLetterOrDigit(ch)).ToArray()).ToLower();
            var g = string.Format("soundcloud%3Agenres%3A{0}", processed);
            parameters.Add("genre", g);
            parameters.Add("linked_partitioning", 1);

            var tracks = soundCloudRawClient.Request<ChartTrackList>(prefix, command, HttpMethod.Get, parameters: parameters.SetPagination(offset, limit), domain: Internal.Client.Helpers.Domain.ApiV2, responseType: string.Empty);
            return tracks.Tracks.Select(ct => trackConverter.Convert(ct.Track)).ToArray();
        }