Exemplo n.º 1
0
        public async Task <ActionResult <IEnumerable <Artist> > > GetFollowedArtists(string userId,
                                                                                     [FromQuery] string location)
        {
            var user = await _userService.GetUserById(userId);

            var followedArtists = await _spotifyService.GetFollowedArtists(user.SpotifyUserId);

            var result =
                await _artistService.FilterArtistsWithEventsUsingAreaCalendar(followedArtists, new Location(location));

            return(Ok(result));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Selection(string city)
        {
            var location = new Location(city);
            var user     = await _userManager.GetUserAsync(User);

            var followedArtists = await _spotifyService.GetFollowedArtists(user.SpotifyUserId);

            var followedArtistsWithEvents =
                await _artistService.FilterArtistsWithEventsUsingAreaCalendar(followedArtists, location);

            var model = new SelectionViewModel
            {
                Artists  = followedArtistsWithEvents,
                User     = user,
                Location = location
            };

            return(View(model));
        }