public int DoScrapeNew(string artist, string album, bool externalAccess)
        {
            if (!MediaPortal.Util.Win32API.IsConnectedToInternet())
            {
              logger.Debug("No internet connection detected. Cancelling new scrape.");
              return 0 ;
            }

            if (!StopScraper)
            {
                try
                {
                    var GetImages = 0;
                    if (artist != null && artist.Trim().Length > 0)
                    {
                    #region NowPlaying Artist
                        var dbartist = Utils.GetArtist(artist, Utils.Category.MusicFanartScraped);
                        var dbalbum = Utils.GetAlbum(album, Utils.Category.MusicFanartScraped);
                        var MaxImages = checked(Convert.ToInt32(Utils.ScraperMaxImages,CultureInfo.CurrentCulture));
                        var numberOfFanartImages = GetNumberOfFanartImages(dbartist);
                        var doTriggerRefresh = (numberOfFanartImages == 0 && !externalAccess);

                        if (checked (MaxImages - numberOfFanartImages) <= 0)
                          GetImages = 8888 ;
                        else
                          {
                            scraper = new Scraper();
                            lock (lockObject)
                                dbClient.Execute("BEGIN TRANSACTION;");
                            GetImages = scraper.GetArtistFanart(artist, MaxImages, this, false, doTriggerRefresh, externalAccess, true);
                            lock (lockObject)
                                dbClient.Execute("COMMIT;");
                            scraper = null;
                          }
                        switch (GetImages)
                        {
                            case 0:
                                if (GetNumberOfFanartImages(dbartist) == 0)
                                  logger.Info("No fanart found for Artist: " + artist + ".");
                                break;
                            case 8888:
                                UpdateTimeStamp(dbartist, null, Utils.Category.MusicFanartScraped) ;
                                logger.Info("Artist: " + artist + " has already maximum number of images. Will not download anymore images for this artist.");
                                break;
                        }
                        if (StopScraper)
                            return GetImages;
                    #endregion
                    #region NowPlaying Artist Thumb
                        if (Utils.ScrapeThumbnails)
                          if (!Utils.GetDbm().HasArtistThumb(dbartist))
                          {
                            scraper = new Scraper();
                            lock (lockObject)
                                dbClient.Execute("BEGIN TRANSACTION;");
                            scraper.GetArtistThumbs(artist, this, true);
                            lock (lockObject)
                                dbClient.Execute("COMMIT;");
                            scraper = null;
                          }
                          else
                            UpdateTimeStamp(dbartist, null, Utils.Category.MusicArtistThumbScraped) ;
                        if (StopScraper)
                            return GetImages;
                    #endregion
                    #region NowPlaying Album Thumb
                        if ((album != null && album.Trim().Length > 0) && Utils.ScrapeThumbnailsAlbum)
                          if (!Utils.GetDbm().HasAlbumThumb(dbartist,dbalbum))
                          {
                            scraper = new Scraper();
                            lock (lockObject)
                                dbClient.Execute("BEGIN TRANSACTION;");
                            scraper.GetArtistAlbumThumbs(artist, album, false, externalAccess);
                            lock (lockObject)
                                dbClient.Execute("COMMIT;");
                            scraper = null;
                          }
                          else
                            UpdateTimeStamp(dbartist, dbalbum, Utils.Category.MusicAlbumThumbScraped) ;
                        if (StopScraper)
                            return GetImages;
                    #endregion
                    } // if (artist != null && artist.Trim().Length > 0)
                    return GetImages;
                }
                catch (Exception ex)
                {
                    scraper = null;
                    logger.Error("DoScrapeNew: " + ex);
                    lock (lockObject)
                        dbClient.Execute("ROLLBACK;");
                }
            }
            return 0;
        }
        public int DoScrape(string artist)
        {
            if (!MediaPortal.Util.Win32API.IsConnectedToInternet())
            {
              logger.Debug("No internet connection detected. Cancelling scrape.");
              return 0 ;
            }

            if (!StopScraper)
            {
                try
                {
                    var GetImages = 0;
                    if (artist != null && artist.Trim().Length > 0)
                    {
                        var dbartist = Utils.GetArtist(artist, Utils.Category.MusicFanartScraped);
                        var MaxImages = checked(Convert.ToInt32(Utils.ScraperMaxImages,CultureInfo.CurrentCulture));
                        var numberOfFanartImages = GetNumberOfFanartImages(Utils.GetArtist(artist, Utils.Category.MusicFanartScraped));
                        var doScrapeFanart = (numberOfFanartImages < MaxImages);

                        if (!doScrapeFanart)
                          GetImages = 8888 ;
                        else
                          {
                            scraper = new Scraper();
                            lock (lockObject)
                                dbClient.Execute("BEGIN TRANSACTION;");
                            GetImages = scraper.GetArtistFanart(artist, MaxImages, this, true, false, false, doScrapeFanart);
                            lock (lockObject)
                                dbClient.Execute("COMMIT;");
                            scraper = null;
                          }
                        if ((GetImages == 0) && (GetNumberOfFanartImages(dbartist) == 0))
                        {
                            logger.Info("No fanart found for Artist: " + artist + ".");
                        }
                        if (GetImages == 8888)
                        {
                            UpdateTimeStamp(dbartist, null, Utils.Category.MusicFanartScraped) ;
                            if (doScrapeFanart)
                              logger.Info("Artist: " + artist + " has already maximum number of images. Will not download anymore images for this artist.");
                        }
                    }
                    return GetImages;
                }
                catch (Exception ex)
                {
                    scraper = null;
                    logger.Error("DoScrape: " + ex);
                    lock (lockObject)
                        dbClient.Execute("ROLLBACK;");
                }
            }
            return 0;
        }