Пример #1
0
        /// <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);
        }