3a868e28b3
When a filename cannot be auto-matched to an existing series name, the organization must be performed manually. Unfortunately not just once, but again and again for each episode coming in. This change proposes a simple but solid method to optionally persist the matching condition from within the manual organization dialog. This approach will make Emby "learn" how to organize files in the future without user interaction.
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using MediaBrowser.Common.Configuration;
|
|
using MediaBrowser.Model.FileOrganization;
|
|
using System.Collections.Generic;
|
|
|
|
namespace MediaBrowser.Server.Implementations.FileOrganization
|
|
{
|
|
public static class ConfigurationExtension
|
|
{
|
|
public static AutoOrganizeOptions GetAutoOrganizeOptions(this IConfigurationManager manager)
|
|
{
|
|
return manager.GetConfiguration<AutoOrganizeOptions>("autoorganize");
|
|
}
|
|
public static void SaveAutoOrganizeOptions(this IConfigurationManager manager, AutoOrganizeOptions options)
|
|
{
|
|
manager.SaveConfiguration("autoorganize", options);
|
|
}
|
|
}
|
|
|
|
public class AutoOrganizeOptionsFactory : IConfigurationFactory
|
|
{
|
|
public IEnumerable<ConfigurationStore> GetConfigurations()
|
|
{
|
|
return new List<ConfigurationStore>
|
|
{
|
|
new ConfigurationStore
|
|
{
|
|
Key = "autoorganize",
|
|
ConfigurationType = typeof (AutoOrganizeOptions)
|
|
}
|
|
};
|
|
}
|
|
}
|
|
}
|