feat: nightly tasks (#19879)
This commit is contained in:
@@ -34,7 +34,7 @@ import {
|
||||
VideoContainer,
|
||||
} from 'src/enum';
|
||||
import { ConcurrentQueueName } from 'src/types';
|
||||
import { IsCronExpression, Optional, ValidateBoolean } from 'src/validation';
|
||||
import { IsCronExpression, IsDateStringFormat, Optional, ValidateBoolean } from 'src/validation';
|
||||
|
||||
const isLibraryScanEnabled = (config: SystemConfigLibraryScanDto) => config.enabled;
|
||||
const isOAuthEnabled = (config: SystemConfigOAuthDto) => config.enabled;
|
||||
@@ -329,6 +329,26 @@ class SystemConfigNewVersionCheckDto {
|
||||
enabled!: boolean;
|
||||
}
|
||||
|
||||
class SystemConfigNightlyTasksDto {
|
||||
@IsDateStringFormat('HH:mm', { message: 'startTime must be in HH:mm format' })
|
||||
startTime!: string;
|
||||
|
||||
@ValidateBoolean()
|
||||
databaseCleanup!: boolean;
|
||||
|
||||
@ValidateBoolean()
|
||||
missingThumbnails!: boolean;
|
||||
|
||||
@ValidateBoolean()
|
||||
clusterNewFaces!: boolean;
|
||||
|
||||
@ValidateBoolean()
|
||||
generateMemories!: boolean;
|
||||
|
||||
@ValidateBoolean()
|
||||
syncQuotaUsage!: boolean;
|
||||
}
|
||||
|
||||
class SystemConfigOAuthDto {
|
||||
@ValidateBoolean()
|
||||
autoLaunch!: boolean;
|
||||
@@ -638,6 +658,11 @@ export class SystemConfigDto implements SystemConfig {
|
||||
@IsObject()
|
||||
newVersionCheck!: SystemConfigNewVersionCheckDto;
|
||||
|
||||
@Type(() => SystemConfigNightlyTasksDto)
|
||||
@ValidateNested()
|
||||
@IsObject()
|
||||
nightlyTasks!: SystemConfigNightlyTasksDto;
|
||||
|
||||
@Type(() => SystemConfigOAuthDto)
|
||||
@ValidateNested()
|
||||
@IsObject()
|
||||
|
||||
Reference in New Issue
Block a user