public ActionResult Index(string sort, string search) { ViewBag.Title = "Artist list"; var model = _artistsService.GetArtists(sort, search); return(View(model)); }
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); }
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, }); }
public AddAlbumViewModel GetAddViewModel() { var artists = _artistsService.GetArtists(); return(new AddAlbumViewModel(artists)); }