feat: nightly tasks (#19879)

This commit is contained in:
Jason Rasmussen
2025-07-11 17:32:10 -04:00
committed by GitHub
parent df581cc0d5
commit 47c0dc0d7e
21 changed files with 538 additions and 60 deletions

View File

@@ -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()