Beispiel #1
0
        public IActionResult OnPost(string[] playlistsToLook)
        {
            if (PlaylistsToLook == null || PlaylistsToLook.Count == 0)
            {
                PlaylistsToLook = PlaylistRequestService.GetUserPlaylists(_context);
            }

            var playlistsToAdd = new List <SpotifyPlaylist>();

            foreach (var playlistId in playlistsToLook)
            {
                playlistsToAdd.Add(PlaylistsToLook.First(x => x.id.Equals(playlistId)));
            }

            PlaylistRequest.PlaylistsToLook = playlistsToAdd;
            _context.PlaylistRequests.Add(PlaylistRequest);

            PlaylistRequestService.ProcessPlaylistRequest(PlaylistRequest, _context);

            return(RedirectToPage("./Confirmation"));
        }
Beispiel #2
0
 public void OnGet()
 {
     PlaylistsToLook = PlaylistRequestService.GetUserPlaylists(_context);
     Images          = PlaylistRequestService.GetImagesForCarousel(_context, PlaylistsToLook).ToList();
 }