private void GetCoverArt()
        {
            if (!Win32API.IsConnectedToInternet())
            {
                return;
            }

            GrabInProgress = true;
            GUICoverArtGrabberResults.CancelledByUser = false;
            _AbortedByUser = false;
            _Abort         = false;

            btnStart.Focus  = false;
            btnCancel.Focus = true;

            progCurrent.Percentage = 0;
            progOverall.Percentage = 0;

            lblCurrentAlbum.Label    = "";
            lblCurrentProgress.Label = "";
            lblFilteredSearch.Label  = "";
            lblFolderName.Label      = "";
            lblOverallProgress.Label = "";

            EnableControls(false);

            // Force a redraw...
            GUIWindowManager.Process();

            if (_MusicDatabase == null)
            {
                _MusicDatabase = MusicDatabase.Instance;
            }

            int albumCount = 0;
            int curCount   = 0;

            songs.Clear();

            try
            {
                ShowWaitCursor();
                string status = GUILocalizeStrings.Get(4503);

                if (status.Length == 0)
                {
                    status = "Getting album count. Please wait...";
                }

                lblCurrentAlbum.Label     = status;
                lblCurrentAlbum.Visible   = true;
                lblFilteredSearch.Visible = true;

                GUIWindowManager.Process();

                Log.Info("Cover art grabber:getting folder count for {0}...", _TopLevelFolderName);
                GetAlbumCount(_TopLevelFolderName, ref albumCount);
                Log.Info("Cover art grabber:{0} folders found", albumCount);
            }

            finally
            {
                HideWaitCursor();
            }

            lblFilteredSearch.Label    = "";
            lblCurrentProgress.Label   = "";
            lblCurrentProgress.Visible = true;
            ShowTotalProgressBar(true);
            GUIWindowManager.Process();

            Log.Info("Cover art grabber:getting pending cover count...");
            GetCoverArtList(_TopLevelFolderName, ref albumCount, ref curCount, _SkipIfCoverArtExists, ref songs);
            Log.Info("Cover art grabber:{0} covers queued for update", albumCount);

            if (_Abort)
            {
                Cleanup();
                return;
            }

            _CoversGrabbed = 0;
            _AbortedByUser = false;
            _AlbumCount    = songs.Count;

            try
            {
                if (_AlbumCount > 0)
                {
                    GuiCoverArtResults =
                        (GUICoverArtGrabberResults)GUIWindowManager.GetWindow((int)Window.WINDOW_MUSIC_COVERART_GRABBER_RESULTS);

                    if (null == GuiCoverArtResults)
                    {
                        return;
                    }

                    GuiCoverArtResults.SearchMode            = GUICoverArtGrabberResults.SearchDepthMode.Share;
                    GuiCoverArtResults.FindCoverArtProgress +=
                        new GUICoverArtGrabberResults.FindCoverArtProgressHandler(OnFindCoverArtProgress);
                    GuiCoverArtResults.FindCoverArtDone +=
                        new GUICoverArtGrabberResults.FindCoverArtDoneHandler(OnFindCoverArtDone);
                    GuiCoverArtResults.AlbumNotFoundRetryingFiltered +=
                        new GUICoverArtGrabberResults.AlbumNotFoundRetryingFilteredHandler(OnAlbumNotFoundRetryingFiltered);

                    ShowTotalProgressBar(true);
                    ShowCurrentProgressBar(true);

                    lblOverallProgress.Visible = true;
                    lblCurrentProgress.Visible = true;

                    GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_REFRESH, 0, 0, 0, GetID, 0, null);
                    GUIWindowManager.SendMessage(msg);

                    for (int i = 0; i < songs.Count; i++)
                    {
                        if (_Abort)
                        {
                            break;
                        }

                        lblFilteredSearch.Clear();
                        lblFilteredSearch.Visible = false;

                        Song curSong = songs[i];
                        CurrentCoverArtIndex = i + 1;
                        SetCurrentCoverArtProgressLabel(curSong.Album, 0);
                        Application.DoEvents();

                        lblCurrentAlbum.Label = string.Format(GrabbingAlbumNameFormatString, curSong.Album);
                        string progressText = GetCurrentProgressString(0, curSong.Album);
                        SetCurrentProgressPercentage(0);
                        SetCurrentCoverArtProgressLabel(progressText, 0);
                        GUIWindowManager.Process();

                        if (curSong.FileName.Length == 0)
                        {
                            continue;
                        }

                        string albumPath = Path.GetDirectoryName(curSong.FileName);
                        GuiCoverArtResults.GetAlbumCovers(curSong.Artist, curSong.Album, albumPath, GetID, true);

                        if (IsAbortedByUser())
                        {
                            break;
                        }

                        GuiCoverArtResults.DoModal(GetID);

                        if (IsAbortedByUser())
                        {
                            break;
                        }

                        if (GuiCoverArtResults.SelectedAlbum != null)
                        {
                            _CoversGrabbed++;

                            if (CoverArtSelected != null)
                            {
                                GuiCoverArtResults.SelectedAlbum.Artist = curSong.Artist;
                                GuiCoverArtResults.SelectedAlbum.Album  = curSong.Album;
                                CoverArtSelected(GuiCoverArtResults.SelectedAlbum, albumPath, _SaveImageToAlbumFolder,
                                                 _SaveImageToThumbsFolder);
                            }
                        }
                    }
                }
            }

            catch (Exception ex)
            {
                Log.Info("Cover art grabber exception:{0}", ex.ToString());
                _GrabCompletedSuccessfully = false;
            }

            finally
            {
                Cleanup();
            }

            if (CoverArtGrabDone != null)
            {
                CoverArtGrabDone(this);
            }

            ShowResultsDialog(_AbortedByUser, _GrabCompletedSuccessfully, _CoversGrabbed, GetID);
        }
    private void GetCoverArt()
    {
      if (!Win32API.IsConnectedToInternet())
      {
        return;
      }

      GrabInProgress = true;
      GUICoverArtGrabberResults.CancelledByUser = false;
      _AbortedByUser = false;
      _Abort = false;

      btnStart.Focus = false;
      btnCancel.Focus = true;

      progCurrent.Percentage = 0;
      progOverall.Percentage = 0;

      lblCurrentAlbum.Label = "";
      lblCurrentProgress.Label = "";
      lblFilteredSearch.Label = "";
      lblFolderName.Label = "";
      lblOverallProgress.Label = "";

      EnableControls(false);

      // Force a redraw...
      GUIWindowManager.Process();

      if (_MusicDatabase == null)
      {
        _MusicDatabase = MusicDatabase.Instance;
      }

      int albumCount = 0;
      int curCount = 0;
      songs.Clear();

      try
      {
        ShowWaitCursor();
        string status = GUILocalizeStrings.Get(4503);

        if (status.Length == 0)
        {
          status = "Getting album count. Please wait...";
        }

        lblCurrentAlbum.Label = status;
        lblCurrentAlbum.Visible = true;
        lblFilteredSearch.Visible = true;

        GUIWindowManager.Process();

        Log.Info("Cover art grabber:getting folder count for {0}...", _TopLevelFolderName);
        GetAlbumCount(_TopLevelFolderName, ref albumCount);
        Log.Info("Cover art grabber:{0} folders found", albumCount);
      }

      finally
      {
        HideWaitCursor();
      }

      lblFilteredSearch.Label = "";
      lblCurrentProgress.Label = "";
      lblCurrentProgress.Visible = true;
      ShowTotalProgressBar(true);
      GUIWindowManager.Process();

      Log.Info("Cover art grabber:getting pending cover count...");
      GetCoverArtList(_TopLevelFolderName, ref albumCount, ref curCount, _SkipIfCoverArtExists, ref songs);
      Log.Info("Cover art grabber:{0} covers queued for update", albumCount);

      if (_Abort)
      {
        Cleanup();
        return;
      }

      _CoversGrabbed = 0;
      _AbortedByUser = false;
      _AlbumCount = songs.Count;

      try
      {
        if (_AlbumCount > 0)
        {
          GuiCoverArtResults =
            (GUICoverArtGrabberResults)GUIWindowManager.GetWindow((int)Window.WINDOW_MUSIC_COVERART_GRABBER_RESULTS);

          if (null == GuiCoverArtResults)
          {
            return;
          }

          GuiCoverArtResults.SearchMode = GUICoverArtGrabberResults.SearchDepthMode.Share;
          GuiCoverArtResults.FindCoverArtProgress +=
            new GUICoverArtGrabberResults.FindCoverArtProgressHandler(OnFindCoverArtProgress);
          GuiCoverArtResults.FindCoverArtDone +=
            new GUICoverArtGrabberResults.FindCoverArtDoneHandler(OnFindCoverArtDone);
          GuiCoverArtResults.AlbumNotFoundRetryingFiltered +=
            new GUICoverArtGrabberResults.AlbumNotFoundRetryingFilteredHandler(OnAlbumNotFoundRetryingFiltered);

          ShowTotalProgressBar(true);
          ShowCurrentProgressBar(true);

          lblOverallProgress.Visible = true;
          lblCurrentProgress.Visible = true;

          GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_REFRESH, 0, 0, 0, GetID, 0, null);
          GUIWindowManager.SendMessage(msg);

          for (int i = 0; i < songs.Count; i++)
          {
            if (_Abort)
            {
              break;
            }

            lblFilteredSearch.Clear();
            lblFilteredSearch.Visible = false;

            Song curSong = songs[i];
            CurrentCoverArtIndex = i + 1;
            SetCurrentCoverArtProgressLabel(curSong.Album, 0);
            Application.DoEvents();

            lblCurrentAlbum.Label = string.Format(GrabbingAlbumNameFormatString, curSong.Album);
            string progressText = GetCurrentProgressString(0, curSong.Album);
            SetCurrentProgressPercentage(0);
            SetCurrentCoverArtProgressLabel(progressText, 0);
            GUIWindowManager.Process();

            if (curSong.FileName.Length == 0)
            {
              continue;
            }

            string albumPath = Path.GetDirectoryName(curSong.FileName);
            GuiCoverArtResults.GetAlbumCovers(curSong.Artist, curSong.Album, albumPath, GetID, true);

            if (IsAbortedByUser())
            {
              break;
            }

            GuiCoverArtResults.DoModal(GetID);

            if (IsAbortedByUser())
            {
              break;
            }

            if (GuiCoverArtResults.SelectedAlbum != null)
            {
              _CoversGrabbed++;

              if (CoverArtSelected != null)
              {
                GuiCoverArtResults.SelectedAlbum.Artist = curSong.Artist;
                GuiCoverArtResults.SelectedAlbum.Album = curSong.Album;
                CoverArtSelected(GuiCoverArtResults.SelectedAlbum, albumPath, _SaveImageToAlbumFolder,
                                 _SaveImageToThumbsFolder);
              }
            }
          }
        }
      }

      catch (Exception ex)
      {
        Log.Info("Cover art grabber exception:{0}", ex.ToString());
        _GrabCompletedSuccessfully = false;
      }

      finally
      {
        Cleanup();
      }

      if (CoverArtGrabDone != null)
      {
        CoverArtGrabDone(this);
      }

      ShowResultsDialog(_AbortedByUser, _GrabCompletedSuccessfully, _CoversGrabbed, GetID);
    }