Exemplo n.º 1
0
        public ActionResult Index(string sort, string search)
        {
            ViewBag.Title = "Artist list";
            var model = _artistsService.GetArtists(sort, search);

            return(View(model));
        }
Exemplo n.º 2
0
        public List <ArtistModel> GetArtists([FromBody] ArtistsPageFilter filter)
        {
            var artists = _artistsService.GetArtists(filter);

            var artistsModels = artists.Select(a => ArtistWebConverter.ToModel(a)).ToList();

            SetIsInLibraryAttribute(artistsModels, filter.LibraryId);

            return(artistsModels);
        }
Exemplo n.º 3
0
        public async Task <IEnumerable <SeedElementsSuggestionsGroup> > GetSeedElementsSuggestionsAsync(string query)
        {
            Task <IEnumerable <Artist> > artistsTask = _artistsService.GetArtists(query);
            Task <IEnumerable <Genre> >  genresTask  = _genresService.GetGenres(query);

            await Task.WhenAll(artistsTask, genresTask);

            IEnumerable <Artist> artists = artistsTask.Result;
            IEnumerable <Genre>  genres  = genresTask.Result;

            SeedElementsSuggestionsGroup artistsSeedSuggestionsGroup = GetArtistsSeedSuggestionGroup(artists);
            SeedElementsSuggestionsGroup genresSeedSuggestionsGroup  = GetGenresSeedSuggestionGroup(genres);

            return(new List <SeedElementsSuggestionsGroup>
            {
                genresSeedSuggestionsGroup,
                artistsSeedSuggestionsGroup,
            });
        }
Exemplo n.º 4
0
        public AddAlbumViewModel GetAddViewModel()
        {
            var artists = _artistsService.GetArtists();

            return(new AddAlbumViewModel(artists));
        }