aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs b/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs
index da3861682..ab79c6a1a 100644
--- a/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs
+++ b/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs
@@ -1,4 +1,5 @@
using MediaBrowser.Common.Configuration;
+using MediaBrowser.Common.Events;
using MediaBrowser.Common.Implementations.Configuration;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration;
@@ -29,6 +30,8 @@ namespace MediaBrowser.Server.Implementations.Configuration
UpdateMetadataPath();
}
+ public event EventHandler<GenericEventArgs<ServerConfiguration>> ConfigurationUpdating;
+
/// <summary>
/// Gets the type of the configuration.
/// </summary>
@@ -73,8 +76,8 @@ namespace MediaBrowser.Server.Implementations.Configuration
/// </summary>
private void UpdateItemsByNamePath()
{
- ((ServerApplicationPaths) ApplicationPaths).ItemsByNamePath = string.IsNullOrEmpty(Configuration.ItemsByNamePath) ?
- null :
+ ((ServerApplicationPaths)ApplicationPaths).ItemsByNamePath = string.IsNullOrEmpty(Configuration.ItemsByNamePath) ?
+ null :
Configuration.ItemsByNamePath;
}
@@ -105,13 +108,15 @@ namespace MediaBrowser.Server.Implementations.Configuration
/// <exception cref="System.IO.DirectoryNotFoundException"></exception>
public override void ReplaceConfiguration(BaseApplicationConfiguration newConfiguration)
{
- var newConfig = (ServerConfiguration) newConfiguration;
+ var newConfig = (ServerConfiguration)newConfiguration;
ValidateItemByNamePath(newConfig);
ValidateTranscodingTempPath(newConfig);
ValidatePathSubstitutions(newConfig);
ValidateMetadataPath(newConfig);
+ EventHelper.FireEventIfNotNull(ConfigurationUpdating, this, new GenericEventArgs<ServerConfiguration> { Argument = newConfig }, Logger);
+
base.ReplaceConfiguration(newConfiguration);
}