SyncConfig.cs 799 B

1234567891011121314151617181920212223242526272829
  1. using MediaBrowser.Common.Configuration;
  2. using MediaBrowser.Model.Sync;
  3. using System.Collections.Generic;
  4. namespace MediaBrowser.Server.Implementations.Sync
  5. {
  6. public class SyncConfigurationFactory : IConfigurationFactory
  7. {
  8. public IEnumerable<ConfigurationStore> GetConfigurations()
  9. {
  10. return new List<ConfigurationStore>
  11. {
  12. new ConfigurationStore
  13. {
  14. ConfigurationType = typeof(SyncOptions),
  15. Key = "sync"
  16. }
  17. };
  18. }
  19. }
  20. public static class SyncExtensions
  21. {
  22. public static SyncOptions GetSyncOptions(this IConfigurationManager config)
  23. {
  24. return config.GetConfiguration<SyncOptions>("sync");
  25. }
  26. }
  27. }