private void buttonCoverAlbumsRefresh_Click(object sender, EventArgs e) { buttonCoverAlbumsRefresh.Enabled = false; buttonCoverAlbumsLookup.Enabled = false; listViewCoverAlbums.Clear(); List <AlbumInfo> CoverAlbums = new List <AlbumInfo>(); MusicDatabase mdb = MusicDatabase.Instance; if (mdb.GetAllAlbums(ref CoverAlbums)) { listViewCoverAlbums.Columns.Add("Artist", 150); listViewCoverAlbums.Columns.Add("Album", 150); listViewCoverAlbums.Columns.Add("Low res", 60); listViewCoverAlbums.Columns.Add("High res", 60); progressBarCoverAlbums.Maximum = CoverAlbums.Count; progressBarCoverAlbums.Value = 0; progressBarCoverAlbums.Visible = true; for (int i = 0; i < CoverAlbums.Count; i++) { try { string curArtist = CoverAlbums[i].AlbumArtist.Trim(new char[] { '|', ' ' }); string curAlbum = CoverAlbums[i].Album; if (curArtist.ToLowerInvariant().Contains("unknown")) { curArtist = CoverAlbums[i].Artist.Trim(new char[] { '|', ' ' }); } ListViewItem listItem = new ListViewItem(curArtist); listItem.SubItems.Add(curAlbum); // check low res string strThumb = Util.Utils.GetAlbumThumbName(curArtist, curAlbum); if (File.Exists(strThumb)) { listItem.SubItems.Add((new FileInfo(strThumb).Length / 1024) + "KB"); } else { listItem.SubItems.Add("none"); Log.Info("Audioscrobbler: Album cover missing: {0} - {1}", curArtist, curAlbum); } // check high res strThumb = Util.Utils.ConvertToLargeCoverArt(strThumb); if (File.Exists(strThumb)) { listItem.SubItems.Add((new FileInfo(strThumb).Length / 1024) + "KB"); } else { listItem.SubItems.Add("none"); } listViewCoverAlbums.Items.Add(listItem); progressBarCoverAlbums.Value = i + 1; } catch (Exception) {} } progressBarCoverAlbums.Visible = false; } buttonCoverAlbumsRefresh.Enabled = true; buttonCoverAlbumsLookup.Enabled = true; }