diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-06-28 00:49:29 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-06-28 00:49:29 -0400 |
| commit | 7ae83e3c45e9318774e896bc588b35aa33295c32 (patch) | |
| tree | 47dfb666dd3c13dab55b74826ee420fa3471cfab /MediaBrowser.Server.Implementations/Library/LibraryManager.cs | |
| parent | 73bc3ac4dc7e4076af025afe9f38387c5035d891 (diff) | |
| parent | bbdd2c5f6a1ce4640d3e11e158c3630f701419c2 (diff) | |
Merge pull request #1884 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/LibraryManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/LibraryManager.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index 883864156..ffcf9f60f 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -2791,6 +2791,31 @@ namespace MediaBrowser.Server.Implementations.Library } _fileSystem.CreateShortcut(lnk, path); + + RemoveContentTypeOverrides(path); + } + + private void RemoveContentTypeOverrides(string path) + { + var removeList = new List<NameValuePair>(); + + foreach (var contentType in ConfigurationManager.Configuration.ContentTypes) + { + if (string.Equals(path, contentType.Name, StringComparison.OrdinalIgnoreCase) + || _fileSystem.ContainsSubPath(path, contentType.Name)) + { + removeList.Add(contentType); + } + } + + if (removeList.Count > 0) + { + ConfigurationManager.Configuration.ContentTypes = ConfigurationManager.Configuration.ContentTypes + .Except(removeList) + .ToArray(); + + ConfigurationManager.SaveConfiguration(); + } } public void RemoveMediaPath(string virtualFolderName, string mediaPath) |
