|
|
@ -84,6 +84,7 @@ namespace Emby.Server.Implementations.AppBase
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The logger.</value>
|
|
|
|
/// <value>The logger.</value>
|
|
|
|
protected ILogger Logger { get; private set; }
|
|
|
|
protected ILogger Logger { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the XML serializer.
|
|
|
|
/// Gets the XML serializer.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -97,7 +98,7 @@ namespace Emby.Server.Implementations.AppBase
|
|
|
|
public IApplicationPaths CommonApplicationPaths { get; private set; }
|
|
|
|
public IApplicationPaths CommonApplicationPaths { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the system configuration.
|
|
|
|
/// Gets or sets the system configuration.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The configuration.</value>
|
|
|
|
/// <value>The configuration.</value>
|
|
|
|
public BaseApplicationConfiguration CommonConfiguration
|
|
|
|
public BaseApplicationConfiguration CommonConfiguration
|
|
|
@ -123,6 +124,7 @@ namespace Emby.Server.Implementations.AppBase
|
|
|
|
return _configuration;
|
|
|
|
return _configuration;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected set
|
|
|
|
protected set
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_configuration = value;
|
|
|
|
_configuration = value;
|
|
|
@ -215,7 +217,7 @@ namespace Emby.Server.Implementations.AppBase
|
|
|
|
cachePath = CommonConfiguration.CachePath;
|
|
|
|
cachePath = CommonConfiguration.CachePath;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Logger.LogInformation("Setting cache path to " + cachePath);
|
|
|
|
Logger.LogInformation("Setting cache path: {Path}", cachePath);
|
|
|
|
((BaseApplicationPaths)CommonApplicationPaths).CachePath = cachePath;
|
|
|
|
((BaseApplicationPaths)CommonApplicationPaths).CachePath = cachePath;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -223,7 +225,7 @@ namespace Emby.Server.Implementations.AppBase
|
|
|
|
/// Replaces the cache path.
|
|
|
|
/// Replaces the cache path.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="newConfig">The new configuration.</param>
|
|
|
|
/// <param name="newConfig">The new configuration.</param>
|
|
|
|
/// <exception cref="DirectoryNotFoundException"></exception>
|
|
|
|
/// <exception cref="DirectoryNotFoundException">The new cache path doesn't exist.</exception>
|
|
|
|
private void ValidateCachePath(BaseApplicationConfiguration newConfig)
|
|
|
|
private void ValidateCachePath(BaseApplicationConfiguration newConfig)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var newPath = newConfig.CachePath;
|
|
|
|
var newPath = newConfig.CachePath;
|
|
|
@ -234,7 +236,7 @@ namespace Emby.Server.Implementations.AppBase
|
|
|
|
// Validate
|
|
|
|
// Validate
|
|
|
|
if (!Directory.Exists(newPath))
|
|
|
|
if (!Directory.Exists(newPath))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new FileNotFoundException(
|
|
|
|
throw new DirectoryNotFoundException(
|
|
|
|
string.Format(
|
|
|
|
string.Format(
|
|
|
|
CultureInfo.InvariantCulture,
|
|
|
|
CultureInfo.InvariantCulture,
|
|
|
|
"{0} does not exist.",
|
|
|
|
"{0} does not exist.",
|
|
|
|