mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
* save thumbnails in subdirectories * migration job, migrate assets and face thumbnails * fix tests * directory depth of two instead of three * cleanup empty dirs after migration * clean up empty dirs after migration, migrate people without assetId * add job card for new migration job * fix removeEmptyDirs race condition because of missing await * cleanup empty directories after asset deletion * move ensurePath to storage core * rename jobs * remove unnecessary property of IEntityJob * use updated person getById, minor refactoring * ensure that directory cleanup doesn't interfere with migration * better description for job in ui * fix remove directories when migration is done * cleanup empty folders at start of migration * fix: actually persist concurrency setting * add comment explaining regex * chore: cleanup --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
89 lines
2.3 KiB
TypeScript
89 lines
2.3 KiB
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { IsBoolean, IsEnum, IsNotEmpty } from 'class-validator';
|
|
import { Optional } from '../domain.util';
|
|
import { JobCommand, QueueName } from './job.constants';
|
|
|
|
export class JobIdParamDto {
|
|
@IsNotEmpty()
|
|
@IsEnum(QueueName)
|
|
@ApiProperty({ type: String, enum: QueueName, enumName: 'JobName' })
|
|
id!: QueueName;
|
|
}
|
|
|
|
export class JobCommandDto {
|
|
@IsNotEmpty()
|
|
@IsEnum(JobCommand)
|
|
@ApiProperty({ type: 'string', enum: JobCommand, enumName: 'JobCommand' })
|
|
command!: JobCommand;
|
|
|
|
@Optional()
|
|
@IsBoolean()
|
|
force!: boolean;
|
|
}
|
|
|
|
export class JobCountsDto {
|
|
@ApiProperty({ type: 'integer' })
|
|
active!: number;
|
|
@ApiProperty({ type: 'integer' })
|
|
completed!: number;
|
|
@ApiProperty({ type: 'integer' })
|
|
failed!: number;
|
|
@ApiProperty({ type: 'integer' })
|
|
delayed!: number;
|
|
@ApiProperty({ type: 'integer' })
|
|
waiting!: number;
|
|
@ApiProperty({ type: 'integer' })
|
|
paused!: number;
|
|
}
|
|
|
|
export class QueueStatusDto {
|
|
isActive!: boolean;
|
|
isPaused!: boolean;
|
|
}
|
|
|
|
export class JobStatusDto {
|
|
@ApiProperty({ type: JobCountsDto })
|
|
jobCounts!: JobCountsDto;
|
|
|
|
@ApiProperty({ type: QueueStatusDto })
|
|
queueStatus!: QueueStatusDto;
|
|
}
|
|
|
|
export class AllJobStatusResponseDto implements Record<QueueName, JobStatusDto> {
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.THUMBNAIL_GENERATION]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.METADATA_EXTRACTION]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.VIDEO_CONVERSION]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.OBJECT_TAGGING]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.CLIP_ENCODING]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.STORAGE_TEMPLATE_MIGRATION]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.MIGRATION]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.BACKGROUND_TASK]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.SEARCH]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.RECOGNIZE_FACES]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.SIDECAR]!: JobStatusDto;
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
[QueueName.LIBRARY]!: JobStatusDto;
|
|
}
|