add basic open subtitle configuration

This commit is contained in:
Luke Pulverenti
2014-05-07 14:38:50 -04:00
parent 0d025f7fb6
commit 9e4b34a4b1
15 changed files with 290 additions and 37 deletions

View File

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