diff --git a/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs b/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs index 52ed2aa84..1af09a01f 100644 --- a/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs +++ b/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs @@ -166,7 +166,7 @@ namespace MediaBrowser.Server.Implementations.Intros private IEnumerable GetResult(BaseItem item, IEnumerable candidates, CinemaModeConfiguration config, int? ratingLevel) { var customIntros = !string.IsNullOrWhiteSpace(config.CustomIntroPath) ? - GetCustomIntros(item) : + GetCustomIntros(config) : new List(); var trailerLimit = config.TrailerLimit; @@ -215,11 +215,11 @@ namespace MediaBrowser.Server.Implementations.Intros return _serverConfig.GetConfiguration("cinemamode"); } - private List GetCustomIntros(BaseItem item) + private List GetCustomIntros(CinemaModeConfiguration options) { try { - return GetCustomIntroFiles() + return GetCustomIntroFiles(options, true, false) .OrderBy(i => Guid.NewGuid()) .Select(i => new IntroInfo { @@ -233,24 +233,22 @@ namespace MediaBrowser.Server.Implementations.Intros } } - private IEnumerable GetCustomIntroFiles(CinemaModeConfiguration options = null) + private IEnumerable GetCustomIntroFiles(CinemaModeConfiguration options, bool enableCustomIntros, bool enableMediaInfoIntros) { - options = options ?? GetOptions(); - var list = new List(); - if (!string.IsNullOrWhiteSpace(options.CustomIntroPath)) + if (enableCustomIntros && !string.IsNullOrWhiteSpace(options.CustomIntroPath)) { list.AddRange(_fileSystem.GetFilePaths(options.CustomIntroPath, true) .Where(_libraryManager.IsVideoFile)); } - if (!string.IsNullOrWhiteSpace(options.MediaInfoIntroPath)) + if (enableMediaInfoIntros && !string.IsNullOrWhiteSpace(options.MediaInfoIntroPath)) { list.AddRange(_fileSystem.GetFilePaths(options.MediaInfoIntroPath, true) .Where(_libraryManager.IsVideoFile)); } - + return list.Distinct(StringComparer.OrdinalIgnoreCase); } @@ -352,7 +350,7 @@ namespace MediaBrowser.Server.Implementations.Intros public IEnumerable GetAllIntroFiles() { - return GetCustomIntroFiles(); + return GetCustomIntroFiles(GetOptions(), true, true); } private bool IsSupporter