2014-07-30 19:09:23 -07:00
|
|
|
|
using MediaBrowser.Common.Configuration;
|
|
|
|
|
using MediaBrowser.Model.FileOrganization;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
2016-11-02 23:37:52 -07:00
|
|
|
|
namespace Emby.Server.Implementations.FileOrganization
|
2014-07-30 19:09:23 -07:00
|
|
|
|
{
|
|
|
|
|
public static class ConfigurationExtension
|
|
|
|
|
{
|
|
|
|
|
public static AutoOrganizeOptions GetAutoOrganizeOptions(this IConfigurationManager manager)
|
|
|
|
|
{
|
|
|
|
|
return manager.GetConfiguration<AutoOrganizeOptions>("autoorganize");
|
|
|
|
|
}
|
2015-09-22 21:12:46 -07:00
|
|
|
|
public static void SaveAutoOrganizeOptions(this IConfigurationManager manager, AutoOrganizeOptions options)
|
|
|
|
|
{
|
|
|
|
|
manager.SaveConfiguration("autoorganize", options);
|
|
|
|
|
}
|
2014-07-30 19:09:23 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class AutoOrganizeOptionsFactory : IConfigurationFactory
|
|
|
|
|
{
|
|
|
|
|
public IEnumerable<ConfigurationStore> GetConfigurations()
|
|
|
|
|
{
|
|
|
|
|
return new List<ConfigurationStore>
|
|
|
|
|
{
|
|
|
|
|
new ConfigurationStore
|
|
|
|
|
{
|
|
|
|
|
Key = "autoorganize",
|
|
|
|
|
ConfigurationType = typeof (AutoOrganizeOptions)
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|