diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/Resolvers')
3 files changed, 12 insertions, 41 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs index 62eb1f47d..b4cda39cd 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs @@ -41,10 +41,19 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio { var collectionType = args.GetCollectionType(); + var isMixed = string.IsNullOrWhiteSpace(collectionType); + + // For conflicting extensions, give priority to videos + if (isMixed && _libraryManager.IsVideoFile(args.Path)) + { + return null; + } + var isStandalone = args.Parent == null; if (isStandalone || - string.Equals(collectionType, CollectionType.Music, StringComparison.OrdinalIgnoreCase)) + string.Equals(collectionType, CollectionType.Music, StringComparison.OrdinalIgnoreCase) || + isMixed) { return new Controller.Entities.Audio.Audio(); } diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs index 5ba07cdae..7f844ca0e 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs @@ -141,12 +141,6 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio if (libraryManager.IsAudioFile(fullName)) { - // Don't resolve these into audio files - if (string.Equals(fileSystem.GetFileNameWithoutExtension(fullName), BaseItem.ThemeSongFilename)) - { - continue; - } - return true; } } diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs index 1efe4e880..ce7491524 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs @@ -99,12 +99,11 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV /// <param name="fileSystemChildren">The file system children.</param> /// <param name="directoryService">The directory service.</param> /// <param name="fileSystem">The file system.</param> + /// <param name="logger">The logger.</param> + /// <param name="libraryManager">The library manager.</param> /// <returns><c>true</c> if [is series folder] [the specified path]; otherwise, <c>false</c>.</returns> public static bool IsSeriesFolder(string path, bool considerSeasonlessEntries, IEnumerable<FileSystemInfo> fileSystemChildren, IDirectoryService directoryService, IFileSystem fileSystem, ILogger logger, ILibraryManager libraryManager) { - // A folder with more than 3 non-season folders in will not becounted as a series - var nonSeriesFolders = 0; - foreach (var child in fileSystemChildren) { var attributes = child.Attributes; @@ -129,19 +128,6 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV //logger.Debug("{0} is a series because of season folder {1}.", path, child.FullName); return true; } - - if (IsBadFolder(child.Name)) - { - logger.Debug("Invalid folder under series: {0}", child.FullName); - - nonSeriesFolders++; - } - - if (nonSeriesFolders >= 3) - { - logger.Debug("{0} not a series due to 3 or more invalid folders.", path); - return false; - } } else { @@ -179,24 +165,6 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV return string.Equals(extension, ".disc", StringComparison.OrdinalIgnoreCase); } - private static bool IsBadFolder(string name) - { - if (string.Equals(name, BaseItem.ThemeSongsFolderName, StringComparison.OrdinalIgnoreCase)) - { - return false; - } - if (string.Equals(name, BaseItem.ThemeVideosFolderName, StringComparison.OrdinalIgnoreCase)) - { - return false; - } - if (string.Equals(name, BaseItem.TrailerFolderName, StringComparison.OrdinalIgnoreCase)) - { - return false; - } - - return !EntityResolutionHelper.IgnoreFolders.Contains(name, StringComparer.OrdinalIgnoreCase); - } - /// <summary> /// Determines whether [is season folder] [the specified path]. /// </summary> |
