Пример #1
0
        private void search_Click(object sender, EventArgs e)
        {
            string query = textBox1.Text;

            // Populating list of artists
            List <SpotifyArtist> artists = _musicLog.GetSpotifyArtists(query);

            foreach (SpotifyArtist artist in artists)
            {
                List <SpotifyAlbum> albums = _musicLog.GetSpotifyAlbums(artist);
                if (albums.Count == 0)
                {
                    continue;
                }

                TreeNode treeNode = new TreeNode(artist.Name);
                treeNode.Tag = artist.SpotifyID;

                treeView1.Nodes.Add(treeNode);
            }
        }
Пример #2
0
        private void RetrieveMissingAlbums_ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Adding missing albums
            var selectedArtist  = (SpotifyArtist)ArtistListView.SelectedItems[0].Tag;
            var retrievedAlbums = _musicLog.GetSpotifyAlbums(selectedArtist);

            _musicLog.AddAlbums(retrievedAlbums, selectedArtist);
            foreach (SpotifyAlbum album in retrievedAlbums)
            {
                _musicLog.AddTracks(_musicLog.GetSpotifyTracks(album), album);
            }

            // Updating listview
            ArtistListView_SelectedIndexChanged(this, EventArgs.Empty);
            TrackListView.Items.Clear();
        }