encapsulate path substitution

This commit is contained in:
Luke Pulverenti
2016-09-12 14:10:09 -04:00
parent e7124e1ec5
commit 151d88f20d
7 changed files with 54 additions and 18 deletions

View File

@@ -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))