/// <summary> /// Loads all covers from the theme /// </summary> private static bool _LoadCovers() { SThemeCover coverTheme = _GetCoverTheme(); Debug.Assert(!String.IsNullOrEmpty(coverTheme.Info.Name)); IEnumerable <string> files = CHelper.ListImageFiles(coverTheme.FolderPath, true, true); lock (_Covers) { foreach (string file in files) { _AddCover(Path.GetFileNameWithoutExtension(file), file); } if (_CoverExists(_NoCoverName)) { NoCover = _Covers[_NoCoverName]; } else if (_CoverExists(_NoCoverNameAlt)) { NoCover = _Covers[_NoCoverNameAlt]; } else { CLog.Fatal("Covertheme \"{ThemeName}\" does not include a cover file named \"{MissingFileName}\" and cannot be used!", CLog.Params(coverTheme.Info.Name, _NoCoverName)); _UnloadCovers(); // Remove current theme and recursively try the other themes _CoverThemes.Remove(coverTheme); return(_CoverThemes.Count > 0 && _LoadCovers()); } } _LoadCoverGenerators(coverTheme); return(true); }
private static void _LoadCoverGenerators(SThemeCover coverTheme) { lock (_CoverGenerators) { foreach (SThemeCoverGenerator theme in coverTheme.CoverGenerators) { if (_CoverGenerators.ContainsKey(theme.Type)) { continue; } CCoverGenerator el = new CCoverGenerator(theme, coverTheme.FolderPath); _CoverGenerators.Add(theme.Type, el); } } }