mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-07 02:36:20 +00:00
encapsulate path substitution
This commit is contained in:
@@ -1516,10 +1516,7 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
|
||||
if (locationType == LocationType.FileSystem || locationType == LocationType.Offline)
|
||||
{
|
||||
foreach (var map in _config.Configuration.PathSubstitutions)
|
||||
{
|
||||
path = _libraryManager.SubstitutePath(path, map.From, map.To);
|
||||
}
|
||||
path = _libraryManager.GetPathAfterNetworkSubstitution(path);
|
||||
}
|
||||
|
||||
return path;
|
||||
|
||||
@@ -2527,6 +2527,16 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
}).OrderBy(i => i.Path).ToList();
|
||||
}
|
||||
|
||||
public string GetPathAfterNetworkSubstitution(string path)
|
||||
{
|
||||
foreach (var map in ConfigurationManager.Configuration.PathSubstitutions)
|
||||
{
|
||||
path = SubstitutePath(path, map.From, map.To);
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
public string SubstitutePath(string path, string from, string to)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(path))
|
||||
|
||||
Reference in New Issue
Block a user