Esempio n. 1
0
        public async Task <ActionResult> Index(string artistId)
        {
            Artist artist = await spotifyService.GetArtist(artistId);

            List <Track> topTracks = null;

            if (artist.id != null)
            {
                // Set cookie for homepage's related artists section
                Response.Cookies["cookie"].Value = artist.id;

                topTracks = await spotifyService.GetArtistTopTracks(artistId);

                List <Album> albums = await spotifyService.GetArtistAlbums(artistId);

                artist.youtubeProfile = await youtubeService.GetYoutubeChannel(artist.name);

                wikipediaService.GetArticleIntro(artist);

                // geniusService.SetTrackLyrics("PNL");

                ViewBag.Albums            = albums;
                ViewBag.ArtistName        = artist.name;
                ViewBag.ArtistImage       = artist.images[0].url;
                ViewBag.WikiActicle       = artist.wikipediaArticle;
                ViewBag.WikipediaURL      = artist.wikipediaProfile;
                ViewBag.YoutubeChannelURL = artist.youtubeProfile;
                ViewBag.SpotifyURL        = "https://play.spotify.com/artist/" + artist.id;
            }
            return(View(topTracks));
        }