public IEnumerable <Models.Artist> GetArtistBySearchRecomendation(SearchRecomendation searchRecomendation)
        {
            var artistList = new List <Models.Artist>();

            foreach (var genre in searchRecomendation.Genres)
            {
                var recomendations = this.GetArtistByGenreAndYear(genre, searchRecomendation.Year);
                artistList.AddRange(recomendations);
            }
            return(artistList.Where(x => x.Popularity >= Constants.Popularity_50));
        }
        public ActionResult GetRecomendation(FormCollection collection)
        {
            var searchRecomendation = new SearchRecomendation();

            searchRecomendation.Year = collection["year"];
            collection.Remove("year");
            searchRecomendation.Genres = collection.AllKeys;

            var artistModel = _spotifySearchProvider.GetRecomendation(searchRecomendation);

            return(PartialView("ListArtist", artistModel));
        }
Beispiel #3
0
 public IReadOnlyList <Models.Artist> GetRecomendation(SearchRecomendation SearchRecomendation) => _recommendationService.GetArtistBySearchRecomendation(SearchRecomendation).ToList();