updated live tv + nuget

This commit is contained in:
Luke Pulverenti
2013-12-14 20:17:57 -05:00
parent d576108411
commit 01e65c93ee
39 changed files with 1002 additions and 426 deletions

View File

@@ -69,10 +69,9 @@ namespace MediaBrowser.Server.Implementations.Configuration
/// </summary>
private void UpdateItemsByNamePath()
{
if (!string.IsNullOrEmpty(Configuration.ItemsByNamePath))
{
ApplicationPaths.ItemsByNamePath = Configuration.ItemsByNamePath;
}
((ServerApplicationPaths) ApplicationPaths).ItemsByNamePath = string.IsNullOrEmpty(Configuration.ItemsByNamePath) ?
null :
Configuration.ItemsByNamePath;
}
/// <summary>
@@ -84,19 +83,29 @@ namespace MediaBrowser.Server.Implementations.Configuration
{
var newConfig = (ServerConfiguration) newConfiguration;
var newIbnPath = newConfig.ItemsByNamePath;
if (!string.IsNullOrWhiteSpace(newIbnPath)
&& !string.Equals(Configuration.ItemsByNamePath ?? string.Empty, newIbnPath))
{
// Validate
if (!Directory.Exists(newIbnPath))
{
throw new DirectoryNotFoundException(string.Format("{0} does not exist.", newConfig.ItemsByNamePath));
}
}
ValidateItemByNamePath(newConfig);
base.ReplaceConfiguration(newConfiguration);
}
/// <summary>
/// Replaces the item by name path.
/// </summary>
/// <param name="newConfig">The new configuration.</param>
/// <exception cref="System.IO.DirectoryNotFoundException"></exception>
private void ValidateItemByNamePath(ServerConfiguration newConfig)
{
var newPath = newConfig.ItemsByNamePath;
if (!string.IsNullOrWhiteSpace(newPath)
&& !string.Equals(Configuration.ItemsByNamePath ?? string.Empty, newPath))
{
// Validate
if (!Directory.Exists(newPath))
{
throw new DirectoryNotFoundException(string.Format("{0} does not exist.", newPath));
}
}
}
}
}