mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
cleanup content overrides when adding library paths
This commit is contained in:
parent
ff3f6661ec
commit
35e83dc73d
@ -70,11 +70,7 @@ namespace MediaBrowser.Api
|
|||||||
Cultures = _localizationManager.GetCultures().ToList()
|
Cultures = _localizationManager.GetCultures().ToList()
|
||||||
};
|
};
|
||||||
|
|
||||||
var locationType = item.LocationType;
|
if (!item.IsVirtualItem && !(item is ICollectionFolder) && !(item is UserView) && !(item is AggregateFolder) && !(item is LiveTvChannel) && !(item is IItemByName))
|
||||||
if (locationType == LocationType.FileSystem ||
|
|
||||||
locationType == LocationType.Offline)
|
|
||||||
{
|
|
||||||
if (!(item is ICollectionFolder) && !(item is UserView) && !(item is AggregateFolder) && !(item is LiveTvChannel) && !(item is IItemByName))
|
|
||||||
{
|
{
|
||||||
var inheritedContentType = _libraryManager.GetInheritedContentType(item);
|
var inheritedContentType = _libraryManager.GetInheritedContentType(item);
|
||||||
var configuredContentType = _libraryManager.GetConfiguredContentType(item);
|
var configuredContentType = _libraryManager.GetConfiguredContentType(item);
|
||||||
@ -92,7 +88,6 @@ namespace MediaBrowser.Api
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return ToOptimizedResult(info);
|
return ToOptimizedResult(info);
|
||||||
}
|
}
|
||||||
|
@ -2791,6 +2791,31 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||||||
}
|
}
|
||||||
|
|
||||||
_fileSystem.CreateShortcut(lnk, path);
|
_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)
|
public void RemoveMediaPath(string virtualFolderName, string mediaPath)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user