public async void UpdateTrack(Track track) { _currentTrack = track; advertLabel.Text = track.IsAd() ? "ADVERT" : ""; timeProgressBar.Maximum = track.Length; if (track.IsAd()) return; //Don't process further, maybe null values titleLinkLabel.Text = track.TrackResource.Name; titleLinkLabel.Tag = track.TrackResource.Uri; artistLinkLabel.Text = track.ArtistResource.Name; artistLinkLabel.Tag = track.ArtistResource.Uri; albumLinkLabel.Text = track.AlbumResource.Name; albumLinkLabel.Tag = track.AlbumResource.Uri; SpotifyUri uri = track.TrackResource.ParseUri(); trackInfoBox.Text = $@"Track Info - {uri.Id}"; bigAlbumPicture.Image = await track.GetAlbumArtAsync(AlbumArtSize.Size640); smallAlbumPicture.Image = await track.GetAlbumArtAsync(AlbumArtSize.Size160); }
public void ShowUpdatedTrack(Track track, bool isDisplayed) { string pendingMessage = ""; if (track.IsAd()) return; // Don't process further, maybe null values // display track Console.WriteLine("Song: " + track.TrackResource.Name); Console.WriteLine("Artist: " + track.ArtistResource.Name); Console.WriteLine("Album: " + track.AlbumResource.Name + "\n"); // if song is allowed to be displayed to the chat if (isDisplayed) { pendingMessage = "Current Song: " + track.TrackResource.Name + " || Artist: " + track.ArtistResource.Name + " || Album: " + track.AlbumResource.Name; Program._lstTupDelayMsg.Add(new Tuple<string, DateTime>( pendingMessage, DateTime.Now.AddSeconds(Program._intStreamLatency) ) ); } }