diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-01-29 18:57:01 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-29 18:57:01 -0500 |
| commit | 3c33e1bb4b7ec59ee17c48f637853b9705c6aa7e (patch) | |
| tree | 566b1bec181f44826bf7a746459060df5d619cf9 /Emby.Server.Implementations/Library | |
| parent | c1b366e48c2aaa5b2c18dad01d58b19d07520fe7 (diff) | |
| parent | ab026ab2dea7419074cb32ad660f937010db7dab (diff) | |
Merge pull request #2430 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/Library')
| -rw-r--r-- | Emby.Server.Implementations/Library/LibraryManager.cs | 18 | ||||
| -rw-r--r-- | Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs | 21 |
2 files changed, 24 insertions, 15 deletions
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index de029cd22..372a99853 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -501,7 +501,7 @@ namespace Emby.Server.Implementations.Library throw new ArgumentNullException("type"); } - if (key.StartsWith(ConfigurationManager.ApplicationPaths.ProgramDataPath)) + if (ConfigurationManager.Configuration.EnableLocalizedGuids && key.StartsWith(ConfigurationManager.ApplicationPaths.ProgramDataPath)) { // Try to normalize paths located underneath program-data in an attempt to make them more portable key = key.Substring(ConfigurationManager.ApplicationPaths.ProgramDataPath.Length) @@ -1927,11 +1927,18 @@ namespace Emby.Server.Implementations.Library return ItemRepository.RetrieveItem(id); } - public IEnumerable<Folder> GetCollectionFolders(BaseItem item) + public List<Folder> GetCollectionFolders(BaseItem item) { - while (!(item.GetParent() is AggregateFolder) && item.GetParent() != null) + while (item != null) { - item = item.GetParent(); + var parent = item.GetParent(); + + if (parent == null || parent is AggregateFolder) + { + break; + } + + item = parent; } if (item == null) @@ -1941,7 +1948,8 @@ namespace Emby.Server.Implementations.Library return GetUserRootFolder().Children .OfType<Folder>() - .Where(i => string.Equals(i.Path, item.Path, StringComparison.OrdinalIgnoreCase) || i.PhysicalLocations.Contains(item.Path, StringComparer.OrdinalIgnoreCase)); + .Where(i => string.Equals(i.Path, item.Path, StringComparison.OrdinalIgnoreCase) || i.PhysicalLocations.Contains(item.Path, StringComparer.OrdinalIgnoreCase)) + .ToList(); } public LibraryOptions GetLibraryOptions(BaseItem item) diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs index 2971405b9..6cf201990 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs @@ -74,20 +74,21 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio return new MusicArtist(); } - if (_config.Configuration.EnableSimpleArtistDetection) - { - return null; - } + return null; + //if (_config.Configuration.EnableSimpleArtistDetection) + //{ + // return null; + //} - // Avoid mis-identifying top folders - if (args.Parent.IsRoot) return null; + //// Avoid mis-identifying top folders + //if (args.Parent.IsRoot) return null; - var directoryService = args.DirectoryService; + //var directoryService = args.DirectoryService; - var albumResolver = new MusicAlbumResolver(_logger, _fileSystem, _libraryManager); + //var albumResolver = new MusicAlbumResolver(_logger, _fileSystem, _libraryManager); - // If we contain an album assume we are an artist folder - return args.FileSystemChildren.Where(i => i.IsDirectory).Any(i => albumResolver.IsMusicAlbum(i.FullName, directoryService, args.GetLibraryOptions())) ? new MusicArtist() : null; + //// If we contain an album assume we are an artist folder + //return args.FileSystemChildren.Where(i => i.IsDirectory).Any(i => albumResolver.IsMusicAlbum(i.FullName, directoryService, args.GetLibraryOptions())) ? new MusicArtist() : null; } } |
