예제 #1
0
        public async Task <RecommendationsResponseDTO> GetRecommendations(string artistsIDs, string genresIDs)
        {
            RecommendationsResponseDTO recommendations = null;

            // double work here wanted a list of strings but got a string of comma separated items
            // so first to an array the passed as List
            // TODO: see if possible to receive a list of strings from js
            List <string> artists = artistsIDs != null?artistsIDs.Split(',').ToList() : null;

            List <string> genres = genresIDs != null?genresIDs.Split(',').ToList() : null;

            recommendations = await rest.GetRecommendationsAsync(await RetrieveToken(), artists, genres);

            return(recommendations);
        }