public void RefreshRandomTVImageProperties(RefreshWorker rw) { FillPropertyRandom(Utils.Category.TvManual, ref currAnyTVUser, ref PrevSelectedTVUser, "tv.userdef", ref ListAnyTVUser); if (rw != null /*&& WindowOpen*/) rw.ReportProgress(10, "TV Updated Properties"); }
public void RefreshRandomTVSeriesImageProperties(RefreshWorker rw) { FillPropertyRandom(Utils.Category.TvSeriesScraped, ref currAnyTVSeries, ref PrevSelectedTVSeries, "tvseries", ref ListAnyTVSeries); if (rw != null /*&& WindowOpen*/) rw.ReportProgress(10, "TVSeries Updated Properties"); }
public void RefreshRandomPluginsImageProperties(RefreshWorker rw) { FillPropertyRandom(Utils.Category.PluginManual, ref currAnyPluginsUser, ref PrevSelectedPluginsUser, "plugins.userdef", ref ListAnyPluginsUser); if (rw != null /*&& WindowOpen*/) rw.ReportProgress(10, "PlugIns Updated Properties"); }
public void RefreshRandomScoreCenterImageProperties(RefreshWorker rw) { FillPropertyRandom(Utils.Category.SportsManual, ref currAnyScorecenterUser, ref PrevSelectedScorecenterUser, "scorecenter.userdef", ref ListAnyScorecenterUser); if (rw != null /*&& WindowOpen*/) rw.ReportProgress(10, "ScoreCenter Updated Properties"); }
public void RefreshRandomMusicImageProperties(RefreshWorker rw) { FillPropertyRandom(Utils.Category.MusicFanartManual, ref currAnyMusicUser, ref PrevSelectedMusicUser, "music.userdef", ref ListAnyMusicUser); FillPropertyRandom(Utils.Category.MusicFanartScraped, ref currAnyMusicScraper, ref PrevSelectedMusicScraper, "music.scraper", ref ListAnyMusicScraper); if (rw != null /*&& WindowOpen*/) rw.ReportProgress(10, "Music Updated Properties"); }
public void RefreshRandomMoviesImageProperties(RefreshWorker rw) { FillPropertyRandom(Utils.Category.MovieManual, ref currAnyMoviesUser, ref PrevSelectedMoviesUser, "movie.userdef", ref ListAnyMoviesUser); FillPropertyRandom(Utils.Category.MovieScraped, ref currAnyMoviesScraper, ref PrevSelectedMoviesScraper, "movie.scraper", ref ListAnyMoviesScraper); FillPropertyRandom(Utils.Category.MovingPictureManual, ref currAnyMovingPictures, ref PrevSelectedMovingPictures, "movingpicture", ref ListAnyMovingPictures); if (rw != null /*&& WindowOpen*/) rw.ReportProgress(10, "Movies Updated Properties"); }
public void RefreshRandomImageProperties(RefreshWorker rw) { try { if (Utils.GetIsStopping()) return; if (RefreshTickCount >= Utils.MaxRefreshTickCount || RefreshTickCount == 0) { // var stopwatch = System.Diagnostics.Stopwatch.StartNew(); var str = string.Empty; Parallel.Invoke(() => { RefreshRandomMoviesImageProperties(rw); }, () => { RefreshRandomMusicImageProperties(rw); }, () => { RefreshRandomTVImageProperties(rw); }, () => { RefreshRandomTVSeriesImageProperties(rw); }, () => { RefreshRandomPicturesImageProperties(rw); }, () => { RefreshRandomGamesImageProperties(rw); }, () => { RefreshRandomScoreCenterImageProperties(rw); }, () => { RefreshRandomPluginsImageProperties(rw); }); ResetRefreshTickCount(); if (rw != null /*&& WindowOpen*/) rw.ReportProgress(90, "Updated Properties"); // stopwatch.Stop(); // logger.Debug("Refreshing Random properties is done. FanartAvailable: {1} Time elapsed: {0}.", stopwatch.Elapsed, Utils.Check(FanartAvailable)); } if (rw == null) return; rw.ReportProgress(100, "Updated Properties"); } catch (Exception ex) { logger.Error("RefreshRandomImageProperties: " + ex); } }
public void RefreshRandomGamesImageProperties(RefreshWorker rw) { FillPropertyRandom(Utils.Category.GameManual, ref currAnyGamesUser, ref PrevSelectedGamesUser, "games.userdef", ref ListAnyGamesUser); if (rw != null /*&& WindowOpen*/) rw.ReportProgress(10, "Games Updated Properties"); }
public void RefreshRandomImageProperties(RefreshWorker rw) { try { if (Utils.GetIsStopping()) return; var doPerm = false; if (PropertiesRandomPerm.Count == 0) doPerm = true; if (CurrCountRandom >= FanartHandlerSetup.Fh.MaxCountImage || FirstRandom || CurrCountRandom == 0) { var str = string.Empty; #region Movies if (SupportsRandomImages("useRandomMoviesUserFanart").Equals("True", StringComparison.CurrentCulture)) { var randomFilename = GetRandomFilename(ref currAnyMoviesUser, Utils.Category.MovieManual, ref PrevSelectedMoviesUser); if (!string.IsNullOrEmpty(randomFilename)) { if (DoShowImageOneRandom) { AddPropertyRandom("#fanarthandler.movie.userdef.backdrop1.any", randomFilename, ref ListAnyMoviesUser, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.movie.userdef.backdrop2.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.movie.userdef.backdrop2.any", randomFilename, ref ListAnyMoviesUser, doPerm); } else { AddPropertyRandom("#fanarthandler.movie.userdef.backdrop2.any", randomFilename, ref ListAnyMoviesUser, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.movie.userdef.backdrop1.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.movie.userdef.backdrop1.any", randomFilename, ref ListAnyMoviesUser, doPerm); } if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } else { FanartHandlerSetup.Fh.SetProperty("#fanarthandler.movie.userdef.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.movie.userdef.backdrop2.any", string.Empty); PrevSelectedMoviesUser = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } } else { FanartHandlerSetup.Fh.EmptyAllImages(ref ListAnyMoviesUser); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.movie.userdef.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.movie.userdef.backdrop2.any", string.Empty); PrevSelectedMoviesUser = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } if (SupportsRandomImages("useRandomMoviesScraperFanart").Equals("True", StringComparison.CurrentCulture)) { var randomFilename = GetRandomFilename(ref currAnyMoviesScraper, Utils.Category.MovieScraped, ref PrevSelectedMoviesScraper); if (!string.IsNullOrEmpty(randomFilename)) { if (DoShowImageOneRandom) { AddPropertyRandom("#fanarthandler.movie.scraper.backdrop1.any", randomFilename, ref ListAnyMoviesScraper, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.movie.scraper.backdrop2.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.movie.scraper.backdrop2.any", randomFilename, ref ListAnyMoviesScraper, doPerm); } else { AddPropertyRandom("#fanarthandler.movie.scraper.backdrop2.any", randomFilename, ref ListAnyMoviesScraper, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.movie.scraper.backdrop1.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.movie.scraper.backdrop1.any", randomFilename, ref ListAnyMoviesScraper, doPerm); } if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } else { FanartHandlerSetup.Fh.SetProperty("#fanarthandler.scraper.movie.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.scraper.movie.backdrop2.any", string.Empty); PrevSelectedMoviesScraper = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } } else { FanartHandlerSetup.Fh.EmptyAllImages(ref ListAnyMoviesScraper); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.movie.scraper.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.movie.scraper.backdrop2.any", string.Empty); PrevSelectedMoviesScraper = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } if (SupportsRandomImages("useRandomMovingPicturesFanart").Equals("True", StringComparison.CurrentCulture)) { var randomFilename = GetRandomFilename(ref currAnyMovingPictures, Utils.Category.MovingPictureManual, ref PrevSelectedMovingPictures); if (!string.IsNullOrEmpty(randomFilename)) { if (DoShowImageOneRandom) { AddPropertyRandom("#fanarthandler.movingpicture.backdrop1.any", randomFilename, ref ListAnyMovingPictures, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.movingpicture.backdrop2.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.movingpicture.backdrop2.any", randomFilename, ref ListAnyMovingPictures, doPerm); } else { AddPropertyRandom("#fanarthandler.movingpicture.backdrop2.any", randomFilename, ref ListAnyMovingPictures, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.movingpicture.backdrop1.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.movingpicture.backdrop1.any", randomFilename, ref ListAnyMovingPictures, doPerm); } if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } else { FanartHandlerSetup.Fh.SetProperty("#fanarthandler.movingpicture.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.movingpicture.backdrop2.any", string.Empty); PrevSelectedMovingPictures = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } } else { FanartHandlerSetup.Fh.EmptyAllImages(ref ListAnyMovingPictures); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.movingpicture.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.movingpicture.backdrop2.any", string.Empty); PrevSelectedMovingPictures = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } #endregion #region Music if (SupportsRandomImages("useRandomMusicUserFanart").Equals("True", StringComparison.CurrentCulture)) { var randomFilename = GetRandomFilename(ref currAnyMusicUser, Utils.Category.MusicFanartManual, ref PrevSelectedMusicUser); if (!string.IsNullOrEmpty(randomFilename)) { if (DoShowImageOneRandom) { AddPropertyRandom("#fanarthandler.music.userdef.backdrop1.any", randomFilename, ref ListAnyMusicUser, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.music.userdef.backdrop2.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.music.userdef.backdrop2.any", randomFilename, ref ListAnyMusicUser, doPerm); } else { AddPropertyRandom("#fanarthandler.music.userdef.backdrop2.any", randomFilename, ref ListAnyMusicUser, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.music.userdef.backdrop1.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.music.userdef.backdrop1.any", randomFilename, ref ListAnyMusicUser, doPerm); } if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } else { FanartHandlerSetup.Fh.SetProperty("#fanarthandler.music.userdef.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.music.userdef.backdrop2.any", string.Empty); PrevSelectedMusicUser = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } } else { FanartHandlerSetup.Fh.EmptyAllImages(ref ListAnyMusicUser); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.music.userdef.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.music.userdef.backdrop2.any", string.Empty); PrevSelectedMusicUser = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } if (SupportsRandomImages("useRandomMusicScraperFanart").Equals("True", StringComparison.CurrentCulture)) { var randomFilename = GetRandomFilename(ref currAnyMusicScraper, Utils.Category.MusicFanartScraped, ref PrevSelectedMusicScraper); if (!string.IsNullOrEmpty(randomFilename)) { if (DoShowImageOneRandom) { AddPropertyRandom("#fanarthandler.music.scraper.backdrop1.any", randomFilename, ref ListAnyMusicScraper, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.music.scraper.backdrop2.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.music.scraper.backdrop2.any", randomFilename, ref ListAnyMusicScraper, doPerm); } else { AddPropertyRandom("#fanarthandler.music.scraper.backdrop2.any", randomFilename, ref ListAnyMusicScraper, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.music.scraper.backdrop1.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.music.scraper.backdrop1.any", randomFilename, ref ListAnyMusicScraper, doPerm); } if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } else { FanartHandlerSetup.Fh.SetProperty("#fanarthandler.music.scraper.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.music.scraper.backdrop2.any", string.Empty); PrevSelectedMusicScraper = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } } else { FanartHandlerSetup.Fh.EmptyAllImages(ref ListAnyMusicScraper); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.music.scraper.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.music.scraper.backdrop2.any", string.Empty); PrevSelectedMusicScraper = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } #endregion #region TV if (SupportsRandomImages("useRandomTVUserFanart").Equals("True", StringComparison.CurrentCulture)) { var randomFilename = GetRandomFilename(ref currAnyTVUser, Utils.Category.TvManual, ref PrevSelectedTVUser); if (!string.IsNullOrEmpty(randomFilename)) { if (DoShowImageOneRandom) { AddPropertyRandom("#fanarthandler.tv.userdef.backdrop1.any", randomFilename, ref ListAnyTVUser, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.tv.userdef.backdrop2.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.tv.userdef.backdrop2.any", randomFilename, ref ListAnyTVUser, doPerm); } else { AddPropertyRandom("#fanarthandler.tv.userdef.backdrop2.any", randomFilename, ref ListAnyTVUser, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.tv.backdrop1.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.tv.userdef.backdrop1.any", randomFilename, ref ListAnyTVUser, doPerm); } if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } else { FanartHandlerSetup.Fh.SetProperty("#fanarthandler.tv.userdef.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.tv.userdef.backdrop2.any", string.Empty); PrevSelectedTVUser = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } } else { FanartHandlerSetup.Fh.EmptyAllImages(ref ListAnyTVUser); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.tv.userdef.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.tv.userdef.backdrop2.any", string.Empty); PrevSelectedTVUser = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } #endregion #region TVSeries if (SupportsRandomImages("useRandomTVSeriesFanart").Equals("True", StringComparison.CurrentCulture)) { var randomFilename = GetRandomFilename(ref currAnyTVSeries, Utils.Category.TvSeriesScraped, ref PrevSelectedTVSeries); if (!string.IsNullOrEmpty(randomFilename)) { if (DoShowImageOneRandom) { AddPropertyRandom("#fanarthandler.tvseries.backdrop1.any", randomFilename, ref ListAnyTVSeries, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.tvseries.backdrop2.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.tvseries.backdrop2.any", randomFilename, ref ListAnyTVSeries, doPerm); } else { AddPropertyRandom("#fanarthandler.tvseries.backdrop2.any", randomFilename, ref ListAnyTVSeries, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.tvseries.backdrop1.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.tvseries.backdrop1.any", randomFilename, ref ListAnyTVSeries, doPerm); } if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } else { FanartHandlerSetup.Fh.SetProperty("#fanarthandler.tvseries.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.tvseries.backdrop2.any", string.Empty); PrevSelectedTVSeries = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } } else { FanartHandlerSetup.Fh.EmptyAllImages(ref ListAnyTVSeries); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.tvseries.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.tvseries.backdrop2.any", string.Empty); PrevSelectedTVSeries = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } #endregion #region Pictures if (SupportsRandomImages("useRandomPicturesUserFanart").Equals("True", StringComparison.CurrentCulture)) { var randomFilename = GetRandomFilename(ref currAnyPicturesUser, Utils.Category.PictureManual, ref PrevSelectedPicturesUser); if (!string.IsNullOrEmpty(randomFilename)) { if (DoShowImageOneRandom) { AddPropertyRandom("#fanarthandler.picture.userdef.backdrop1.any", randomFilename, ref ListAnyPicturesUser, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.picture.userdef.backdrop2.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.picture.userdef.backdrop2.any", randomFilename, ref ListAnyPicturesUser, doPerm); } else { AddPropertyRandom("#fanarthandler.picture.userdef.backdrop2.any", randomFilename, ref ListAnyPicturesUser, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.picture.userdef.backdrop1.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.picture.userdef.backdrop1.any", randomFilename, ref ListAnyPicturesUser, doPerm); } if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } else { FanartHandlerSetup.Fh.SetProperty("#fanarthandler.picture.userdef.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.picture.userdef.backdrop2.any", string.Empty); PrevSelectedPicturesUser = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } } else { FanartHandlerSetup.Fh.EmptyAllImages(ref ListAnyPicturesUser); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.picture.userdef.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.picture.userdef.backdrop2.any", string.Empty); PrevSelectedPicturesUser = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } #endregion #region Games if (SupportsRandomImages("useRandomGamesUserFanart").Equals("True", StringComparison.CurrentCulture)) { var randomFilename = GetRandomFilename(ref currAnyGamesUser, Utils.Category.GameManual, ref PrevSelectedGamesUser); if (!string.IsNullOrEmpty(randomFilename)) { if (DoShowImageOneRandom) { AddPropertyRandom("#fanarthandler.games.userdef.backdrop1.any", randomFilename, ref ListAnyGamesUser, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.games.userdef.backdrop2.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.games.userdef.backdrop2.any", randomFilename, ref ListAnyGamesUser, doPerm); } else { AddPropertyRandom("#fanarthandler.games.userdef.backdrop2.any", randomFilename, ref ListAnyGamesUser, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.games.userdef.backdrop1.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.games.userdef.backdrop1.any", randomFilename, ref ListAnyGamesUser, doPerm); } if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } else { FanartHandlerSetup.Fh.SetProperty("#fanarthandler.games.userdef.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.games.userdef.backdrop2.any", string.Empty); PrevSelectedGamesUser = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } } else { FanartHandlerSetup.Fh.EmptyAllImages(ref ListAnyGamesUser); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.games.userdef.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.games.userdef.backdrop2.any", string.Empty); PrevSelectedGamesUser = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } #endregion #region ScoreCenter if (SupportsRandomImages("useRandomScoreCenterUserFanart").Equals("True", StringComparison.CurrentCulture)) { var randomFilename = GetRandomFilename(ref currAnyScorecenterUser, Utils.Category.SportsManual, ref PrevSelectedScorecenterUser); if (!string.IsNullOrEmpty(randomFilename)) { if (DoShowImageOneRandom) { AddPropertyRandom("#fanarthandler.scorecenter.userdef.backdrop1.any", randomFilename, ref ListAnyScorecenterUser, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.scorecenter.userdef.backdrop2.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.scorecenter.userdef.backdrop2.any", randomFilename, ref ListAnyScorecenterUser, doPerm); } else { AddPropertyRandom("#fanarthandler.scorecenter.userdef.backdrop2.any", randomFilename, ref ListAnyScorecenterUser, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.scorecenter.userdef.backdrop1.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.scorecenter.userdef.backdrop1.any", randomFilename, ref ListAnyScorecenterUser, doPerm); } if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } else { FanartHandlerSetup.Fh.SetProperty("#fanarthandler.scorecenter.userdef.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.scorecenter.userdef.backdrop2.any", string.Empty); PrevSelectedScorecenterUser = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } } else { FanartHandlerSetup.Fh.EmptyAllImages(ref ListAnyScorecenterUser); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.scorecenter.userdef.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.scorecenter.userdef.backdrop2.any", string.Empty); PrevSelectedScorecenterUser = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } #endregion #region PlugIns if (SupportsRandomImages("useRandomPluginsUserFanart").Equals("True", StringComparison.CurrentCulture)) { var randomFilename = GetRandomFilename(ref currAnyPluginsUser, Utils.Category.PluginManual, ref PrevSelectedPluginsUser); if (!string.IsNullOrEmpty(randomFilename)) { if (DoShowImageOneRandom) { AddPropertyRandom("#fanarthandler.plugins.userdef.backdrop1.any", randomFilename, ref ListAnyPluginsUser, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.plugins.userdef.backdrop2.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.plugins.userdef.backdrop2.any", randomFilename, ref ListAnyPluginsUser, doPerm); } else { AddPropertyRandom("#fanarthandler.plugins.userdef.backdrop2.any", randomFilename, ref ListAnyPluginsUser, doPerm); var property = GUIPropertyManager.GetProperty("#fanarthandler.plugins.userdef.backdrop1.any"); if (property == null || property.Length < 2 || property.EndsWith("transparent.png", StringComparison.CurrentCulture)) AddPropertyRandom("#fanarthandler.plugins.userdef.backdrop1.any", randomFilename, ref ListAnyPluginsUser, doPerm); } if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } else { FanartHandlerSetup.Fh.SetProperty("#fanarthandler.plugins.userdef.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.plugins.userdef.backdrop2.any", string.Empty); PrevSelectedPluginsUser = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } } else { FanartHandlerSetup.Fh.EmptyAllImages(ref ListAnyPluginsUser); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.plugins.userdef.backdrop1.any", string.Empty); FanartHandlerSetup.Fh.SetProperty("#fanarthandler.plugins.userdef.backdrop2.any", string.Empty); PrevSelectedPluginsUser = -1; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } #endregion ResetCurrCountRandom(); FirstRandom = false; if (rw != null && FanartHandlerSetup.Fh.FR.WindowOpen) rw.ReportProgress(100, "Updated Properties"); } IncreaseCurrCountRandom(); if (rw == null) return; rw.ReportProgress(100, "Updated Properties"); } catch (Exception ex) { logger.Error("RefreshRandomImageProperties: " + ex); } }