예제 #1
0
        public MediaManagementConfigController(IConfigService configService,
                                               PathExistsValidator pathExistsValidator,
                                               FolderChmodValidator folderChmodValidator,
                                               FolderWritableValidator folderWritableValidator,
                                               MoviePathValidator moviePathValidator,
                                               StartupFolderValidator startupFolderValidator,
                                               SystemFolderValidator systemFolderValidator,
                                               RootFolderAncestorValidator rootFolderAncestorValidator,
                                               RootFolderValidator rootFolderValidator)
            : base(configService)
        {
            SharedValidator.RuleFor(c => c.RecycleBinCleanupDays).GreaterThanOrEqualTo(0);
            SharedValidator.RuleFor(c => c.ChmodFolder).SetValidator(folderChmodValidator).When(c => !string.IsNullOrEmpty(c.ChmodFolder) && (OsInfo.IsLinux || OsInfo.IsOsx));

            SharedValidator.RuleFor(c => c.RecycleBin).IsValidPath()
            .SetValidator(folderWritableValidator)
            .SetValidator(rootFolderValidator)
            .SetValidator(pathExistsValidator)
            .SetValidator(rootFolderAncestorValidator)
            .SetValidator(startupFolderValidator)
            .SetValidator(systemFolderValidator)
            .SetValidator(moviePathValidator)
            .When(c => !string.IsNullOrWhiteSpace(c.RecycleBin));

            SharedValidator.RuleFor(c => c.MinimumFreeSpaceWhenImporting).GreaterThanOrEqualTo(100);
        }
예제 #2
0
 public MediaManagementConfigModule(IConfigService configService,
                                    PathExistsValidator pathExistsValidator,
                                    FolderChmodValidator folderChmodValidator,
                                    FolderWritableValidator folderWritableValidator,
                                    MoviePathValidator moviePathValidator,
                                    StartupFolderValidator startupFolderValidator,
                                    SystemFolderValidator systemFolderValidator,
                                    RootFolderAncestorValidator rootFolderAncestorValidator,
                                    RootFolderValidator rootFolderValidator)
     : base(configService)
 {
     SharedValidator.RuleFor(c => c.ChmodFolder).SetValidator(folderChmodValidator).When(c => !string.IsNullOrEmpty(c.ChmodFolder) && PlatformInfo.IsMono);
     SharedValidator.RuleFor(c => c.RecycleBin).IsValidPath()
     .SetValidator(folderWritableValidator)
     .SetValidator(rootFolderValidator)
     .SetValidator(pathExistsValidator)
     .SetValidator(moviePathValidator)
     .SetValidator(rootFolderAncestorValidator)
     .SetValidator(startupFolderValidator)
     .SetValidator(systemFolderValidator)
     .When(c => !string.IsNullOrWhiteSpace(c.RecycleBin));
 }
예제 #3
0
 public MediaManagementConfigModule(IConfigService configService, PathExistsValidator pathExistsValidator, FolderChmodValidator folderChmodValidator)
     : base(configService)
 {
     SharedValidator.RuleFor(c => c.RecycleBinCleanupDays).GreaterThanOrEqualTo(0);
     SharedValidator.RuleFor(c => c.ChmodFolder).SetValidator(folderChmodValidator).When(c => !string.IsNullOrEmpty(c.ChmodFolder) && (OsInfo.IsLinux || OsInfo.IsOsx));
     SharedValidator.RuleFor(c => c.RecycleBin).IsValidPath().SetValidator(pathExistsValidator).When(c => !string.IsNullOrWhiteSpace(c.RecycleBin));
     SharedValidator.RuleFor(c => c.MinimumFreeSpaceWhenImporting).GreaterThanOrEqualTo(100);
 }
예제 #4
0
 public MediaManagementConfigModule(IConfigService configService, PathExistsValidator pathExistsValidator, FolderChmodValidator folderChmodValidator)
     : base(configService)
 {
     SharedValidator.RuleFor(c => c.ChmodFolder).SetValidator(folderChmodValidator).When(c => !string.IsNullOrEmpty(c.ChmodFolder) && PlatformInfo.IsMono);
     SharedValidator.RuleFor(c => c.RecycleBin).IsValidPath().SetValidator(pathExistsValidator).When(c => !string.IsNullOrWhiteSpace(c.RecycleBin));
 }