mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-30 15:41:28 +00:00
start on content type setting
This commit is contained in:
parent
659128073e
commit
74520804f8
12 changed files with 197 additions and 12 deletions
|
|
@ -208,11 +208,29 @@ namespace MediaBrowser.Common.Implementations.Configuration
|
|||
|
||||
lock (_configurationSyncLock)
|
||||
{
|
||||
return ConfigurationHelper.GetXmlConfiguration(configurationType, file, XmlSerializer);
|
||||
return LoadConfiguration(file, configurationType);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private object LoadConfiguration(string path, Type configurationType)
|
||||
{
|
||||
try
|
||||
{
|
||||
return XmlSerializer.DeserializeFromFile(configurationType, path);
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
return Activator.CreateInstance(configurationType);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error loading configuration file: {0}", ex, path);
|
||||
|
||||
return Activator.CreateInstance(configurationType);
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveConfiguration(string key, object configuration)
|
||||
{
|
||||
var configurationType = GetConfigurationType(key);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue