Ejemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var albumTracks = _spotifyService.GetAlbumTracks();

            if (albumTracks == null || albumTracks.Items.Count == 0)
            {
                return;
            }
            var albumTracksUrls = new List <string>();

            foreach (var albumTrack in albumTracks.Items)
            {
                albumTracksUrls.Add(albumTrack.PreviewUrl);
            }
            _bassNetService.CallBassNetRegistration();
            _bassNetService.Play(albumTracksUrls);
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Album(string albumId)
        {
            Album album = await spotifyService.GetAlbum(albumId);

            List <Track> albumTracks = null;

            if (album.id != null)
            {
                AlbumTracksRootobject albumTracksObject = await spotifyService.GetAlbumTracks(albumId);

                albumTracks = albumTracksObject.items;
                await youtubeService.AddYoutubeUrl(albumTracks, album.artists[0].name);

                ViewBag.AlbumName   = album.name;
                ViewBag.AlbumImage  = album.images[0].url;
                ViewBag.ReleaseDate = album.release_date;
                ViewBag.Label       = album.label;
                ViewBag.SpotifyURL  = album.external_urls.spotify;
                ViewBag.Copyright   = album.copyrights[0].text;
                ViewBag.Artists     = album.artists;
            }
            return(View(albumTracks));
        }