refactor: orphan -> untracked

This commit is contained in:
izzy
2026-01-07 12:17:28 +00:00
parent d189722bbf
commit ed33f79e2a
27 changed files with 213 additions and 213 deletions

View File

@@ -100,7 +100,7 @@ describe('/admin/integrity', () => {
describe('POST /summary (& jobs)', async () => { describe('POST /summary (& jobs)', async () => {
it.sequential('reports no issues', async () => { it.sequential('reports no issues', async () => {
await utils.createJob(admin.accessToken, { await utils.createJob(admin.accessToken, {
name: ManualJobName.IntegrityOrphanFiles, name: ManualJobName.IntegrityUntrackedFiles,
}); });
await utils.createJob(admin.accessToken, { await utils.createJob(admin.accessToken, {
@@ -112,7 +112,7 @@ describe('/admin/integrity', () => {
}); });
await utils.createJob(admin.accessToken, { await utils.createJob(admin.accessToken, {
name: ManualJobName.IntegrityOrphanFilesDeleteAll, name: ManualJobName.IntegrityUntrackedFilesDeleteAll,
}); });
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck); await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
@@ -125,16 +125,16 @@ describe('/admin/integrity', () => {
expect(status).toBe(200); expect(status).toBe(200);
expect(body).toEqual({ expect(body).toEqual({
missing_file: 0, missing_file: 0,
orphan_file: 0, untracked_file: 0,
checksum_mismatch: 0, checksum_mismatch: 0,
}); });
}); });
it.sequential('should detect an orphan file (job: check orphan files)', async () => { it.sequential('should detect an untracked file (job: check untracked files)', async () => {
await utils.putTextFile('orphan', `/data/upload/${admin.userId}/orphan1.png`); await utils.putTextFile('untracked', `/data/upload/${admin.userId}/untracked1.png`);
await utils.createJob(admin.accessToken, { await utils.createJob(admin.accessToken, {
name: ManualJobName.IntegrityOrphanFiles, name: ManualJobName.IntegrityUntrackedFiles,
}); });
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck); await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
@@ -147,18 +147,18 @@ describe('/admin/integrity', () => {
expect(status).toBe(200); expect(status).toBe(200);
expect(body).toEqual( expect(body).toEqual(
expect.objectContaining({ expect.objectContaining({
orphan_file: 1, untracked_file: 1,
}), }),
); );
}); });
it.sequential('should detect outdated orphan file reports (job: refresh orphan files)', async () => { it.sequential('should detect outdated untracked file reports (job: refresh untracked files)', async () => {
// these should not be detected: // these should not be detected:
await utils.putTextFile('orphan', `/data/upload/${admin.userId}/orphan2.png`); await utils.putTextFile('untracked', `/data/upload/${admin.userId}/untracked2.png`);
await utils.putTextFile('orphan', `/data/upload/${admin.userId}/orphan3.png`); await utils.putTextFile('untracked', `/data/upload/${admin.userId}/untracked3.png`);
await utils.createJob(admin.accessToken, { await utils.createJob(admin.accessToken, {
name: ManualJobName.IntegrityOrphanFilesRefresh, name: ManualJobName.IntegrityUntrackedFilesRefresh,
}); });
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck); await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
@@ -171,22 +171,22 @@ describe('/admin/integrity', () => {
expect(status).toBe(200); expect(status).toBe(200);
expect(body).toEqual( expect(body).toEqual(
expect.objectContaining({ expect.objectContaining({
orphan_file: 0, untracked_file: 0,
}), }),
); );
}); });
it.sequential('should delete orphan files (job: delete all orphan file reports)', async () => { it.sequential('should delete untracked files (job: delete all untracked file reports)', async () => {
await utils.putTextFile('orphan', `/data/upload/${admin.userId}/orphan1.png`); await utils.putTextFile('untracked', `/data/upload/${admin.userId}/untracked1.png`);
await utils.createJob(admin.accessToken, { await utils.createJob(admin.accessToken, {
name: ManualJobName.IntegrityOrphanFiles, name: ManualJobName.IntegrityUntrackedFiles,
}); });
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck); await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
await utils.createJob(admin.accessToken, { await utils.createJob(admin.accessToken, {
name: ManualJobName.IntegrityOrphanFilesDeleteAll, name: ManualJobName.IntegrityUntrackedFilesDeleteAll,
}); });
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck); await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
@@ -199,7 +199,7 @@ describe('/admin/integrity', () => {
expect(status).toBe(200); expect(status).toBe(200);
expect(body).toEqual( expect(body).toEqual(
expect.objectContaining({ expect.objectContaining({
orphan_file: 0, untracked_file: 0,
}), }),
); );
}); });
@@ -387,11 +387,11 @@ describe('/admin/integrity', () => {
}); });
describe('POST /report', async () => { describe('POST /report', async () => {
it.sequential('reports orphan files', async () => { it.sequential('reports untracked files', async () => {
await utils.putTextFile('orphan', `/data/upload/${admin.userId}/orphan1.png`); await utils.putTextFile('untracked', `/data/upload/${admin.userId}/untracked1.png`);
await utils.createJob(admin.accessToken, { await utils.createJob(admin.accessToken, {
name: ManualJobName.IntegrityOrphanFiles, name: ManualJobName.IntegrityUntrackedFiles,
}); });
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck); await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
@@ -399,7 +399,7 @@ describe('/admin/integrity', () => {
const { status, body } = await request(app) const { status, body } = await request(app)
.post('/admin/integrity/report') .post('/admin/integrity/report')
.set('Authorization', `Bearer ${admin.accessToken}`) .set('Authorization', `Bearer ${admin.accessToken}`)
.send({ type: 'orphan_file' }); .send({ type: 'untracked_file' });
expect(status).toBe(200); expect(status).toBe(200);
expect(body).toEqual({ expect(body).toEqual({
@@ -407,8 +407,8 @@ describe('/admin/integrity', () => {
items: expect.arrayContaining([ items: expect.arrayContaining([
{ {
id: expect.any(String), id: expect.any(String),
type: 'orphan_file', type: 'untracked_file',
path: `/data/upload/${admin.userId}/orphan1.png`, path: `/data/upload/${admin.userId}/untracked1.png`,
assetId: null, assetId: null,
fileAssetId: null, fileAssetId: null,
}, },
@@ -476,11 +476,11 @@ describe('/admin/integrity', () => {
}); });
describe('DELETE /report/:id', async () => { describe('DELETE /report/:id', async () => {
it.sequential('delete orphan files', async () => { it.sequential('delete untracked files', async () => {
await utils.putTextFile('orphan', `/data/upload/${admin.userId}/orphan1.png`); await utils.putTextFile('untracked', `/data/upload/${admin.userId}/untracked1.png`);
await utils.createJob(admin.accessToken, { await utils.createJob(admin.accessToken, {
name: ManualJobName.IntegrityOrphanFiles, name: ManualJobName.IntegrityUntrackedFiles,
}); });
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck); await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
@@ -488,12 +488,12 @@ describe('/admin/integrity', () => {
const { status: listStatus, body: listBody } = await request(app) const { status: listStatus, body: listBody } = await request(app)
.post('/admin/integrity/report') .post('/admin/integrity/report')
.set('Authorization', `Bearer ${admin.accessToken}`) .set('Authorization', `Bearer ${admin.accessToken}`)
.send({ type: 'orphan_file' }); .send({ type: 'untracked_file' });
expect(listStatus).toBe(200); expect(listStatus).toBe(200);
const report = (listBody as IntegrityReportResponseDto).items.find( const report = (listBody as IntegrityReportResponseDto).items.find(
(item) => item.path === `/data/upload/${admin.userId}/orphan1.png`, (item) => item.path === `/data/upload/${admin.userId}/untracked1.png`,
)!; )!;
const { status } = await request(app) const { status } = await request(app)
@@ -504,7 +504,7 @@ describe('/admin/integrity', () => {
expect(status).toBe(200); expect(status).toBe(200);
await utils.createJob(admin.accessToken, { await utils.createJob(admin.accessToken, {
name: ManualJobName.IntegrityOrphanFiles, name: ManualJobName.IntegrityUntrackedFiles,
}); });
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck); await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
@@ -512,7 +512,7 @@ describe('/admin/integrity', () => {
const { status: listStatus2, body: listBody2 } = await request(app) const { status: listStatus2, body: listBody2 } = await request(app)
.post('/admin/integrity/report') .post('/admin/integrity/report')
.set('Authorization', `Bearer ${admin.accessToken}`) .set('Authorization', `Bearer ${admin.accessToken}`)
.send({ type: 'orphan_file' }); .send({ type: 'untracked_file' });
expect(listStatus2).toBe(200); expect(listStatus2).toBe(200);
expect(listBody2).not.toBe( expect(listBody2).not.toBe(
@@ -610,17 +610,17 @@ describe('/admin/integrity', () => {
}); });
describe('GET /report/:type/csv', () => { describe('GET /report/:type/csv', () => {
it.sequential('exports orphan files as csv', async () => { it.sequential('exports untracked files as csv', async () => {
await utils.putTextFile('orphan', `/data/upload/${admin.userId}/orphan1.png`); await utils.putTextFile('untracked', `/data/upload/${admin.userId}/untracked1.png`);
await utils.createJob(admin.accessToken, { await utils.createJob(admin.accessToken, {
name: ManualJobName.IntegrityOrphanFiles, name: ManualJobName.IntegrityUntrackedFiles,
}); });
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck); await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
const { status, headers, text } = await request(app) const { status, headers, text } = await request(app)
.get('/admin/integrity/report/orphan_file/csv') .get('/admin/integrity/report/untracked_file/csv')
.set('Authorization', `Bearer ${admin.accessToken}`) .set('Authorization', `Bearer ${admin.accessToken}`)
.send(); .send();
@@ -628,17 +628,17 @@ describe('/admin/integrity', () => {
expect(headers['content-type']).toContain('text/csv'); expect(headers['content-type']).toContain('text/csv');
expect(headers['content-disposition']).toContain('.csv'); expect(headers['content-disposition']).toContain('.csv');
expect(text).toContain('id,type,assetId,fileAssetId,path'); expect(text).toContain('id,type,assetId,fileAssetId,path');
expect(text).toContain(`orphan_file`); expect(text).toContain(`untracked_file`);
expect(text).toContain(`/data/upload/${admin.userId}/orphan1.png`); expect(text).toContain(`/data/upload/${admin.userId}/untracked1.png`);
}); });
}); });
describe('GET /report/:id/file', () => { describe('GET /report/:id/file', () => {
it.sequential('downloads orphan file', async () => { it.sequential('downloads untracked file', async () => {
await utils.putTextFile('orphan-content', `/data/upload/${admin.userId}/orphan1.png`); await utils.putTextFile('untracked-content', `/data/upload/${admin.userId}/untracked1.png`);
await utils.createJob(admin.accessToken, { await utils.createJob(admin.accessToken, {
name: ManualJobName.IntegrityOrphanFiles, name: ManualJobName.IntegrityUntrackedFiles,
}); });
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck); await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
@@ -646,10 +646,10 @@ describe('/admin/integrity', () => {
const { body: listBody } = await request(app) const { body: listBody } = await request(app)
.post('/admin/integrity/report') .post('/admin/integrity/report')
.set('Authorization', `Bearer ${admin.accessToken}`) .set('Authorization', `Bearer ${admin.accessToken}`)
.send({ type: 'orphan_file' }); .send({ type: 'untracked_file' });
const report = (listBody as IntegrityReportResponseDto).items.find( const report = (listBody as IntegrityReportResponseDto).items.find(
(item) => item.path === `/data/upload/${admin.userId}/orphan1.png`, (item) => item.path === `/data/upload/${admin.userId}/untracked1.png`,
)!; )!;
const { status, headers, body } = await request(app) const { status, headers, body } = await request(app)
@@ -660,7 +660,7 @@ describe('/admin/integrity', () => {
expect(status).toBe(200); expect(status).toBe(200);
expect(headers['content-type']).toContain('application/octet-stream'); expect(headers['content-type']).toContain('application/octet-stream');
expect(body.toString()).toBe('orphan-content'); expect(body.toString()).toBe('untracked-content');
}); });
}); });
}); });

View File

@@ -195,9 +195,9 @@
"maintenance_integrity_missing_file": "Missing Files", "maintenance_integrity_missing_file": "Missing Files",
"maintenance_integrity_missing_file_job": "Check for missing files", "maintenance_integrity_missing_file_job": "Check for missing files",
"maintenance_integrity_missing_file_refresh_job": "Refresh missing file reports", "maintenance_integrity_missing_file_refresh_job": "Refresh missing file reports",
"maintenance_integrity_orphan_file": "Orphan Files", "maintenance_integrity_untracked_file": "Untracked Files",
"maintenance_integrity_orphan_file_job": "Check for orphaned files", "maintenance_integrity_untracked_file_job": "Check for untracked files",
"maintenance_integrity_orphan_file_refresh_job": "Refresh orphan file reports", "maintenance_integrity_untracked_file_refresh_job": "Refresh untracked file reports",
"maintenance_integrity_report": "Integrity Report", "maintenance_integrity_report": "Integrity Report",
"maintenance_settings": "Maintenance", "maintenance_settings": "Maintenance",
"maintenance_settings_description": "Put Immich into maintenance mode.", "maintenance_settings_description": "Put Immich into maintenance mode.",

View File

@@ -180,7 +180,7 @@ class MaintenanceAdminApi {
/// Download flagged file /// Download flagged file
/// ///
/// Download the orphan/broken file if one exists /// Download the untracked/broken file if one exists
/// ///
/// Note: This method returns the HTTP [Response]. /// Note: This method returns the HTTP [Response].
/// ///
@@ -215,7 +215,7 @@ class MaintenanceAdminApi {
/// Download flagged file /// Download flagged file
/// ///
/// Download the orphan/broken file if one exists /// Download the untracked/broken file if one exists
/// ///
/// Parameters: /// Parameters:
/// ///

View File

@@ -24,7 +24,7 @@ class IntegrityGetReportDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? cursor; String? cursor;
/// Minimum value: 1 /// Minimum value: 1
/// ///
@@ -56,7 +56,7 @@ class IntegrityGetReportDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.cursor != null) { if (this.cursor != null) {
json[r'cursor'] = this.cursor!.toUtc().toIso8601String(); json[r'cursor'] = this.cursor;
} else { } else {
// json[r'cursor'] = null; // json[r'cursor'] = null;
} }
@@ -78,7 +78,7 @@ class IntegrityGetReportDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return IntegrityGetReportDto( return IntegrityGetReportDto(
cursor: mapDateTime(json, r'cursor', r''), cursor: mapValueOfType<String>(json, r'cursor'),
limit: num.parse('${json[r'limit']}'), limit: num.parse('${json[r'limit']}'),
type: IntegrityReportType.fromJson(json[r'type'])!, type: IntegrityReportType.fromJson(json[r'type'])!,
); );

View File

@@ -25,7 +25,7 @@ class IntegrityReportResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? nextCursor; String? nextCursor;
@override @override
bool operator ==(Object other) => identical(this, other) || other is IntegrityReportResponseDto && bool operator ==(Object other) => identical(this, other) || other is IntegrityReportResponseDto &&
@@ -45,7 +45,7 @@ class IntegrityReportResponseDto {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'items'] = this.items; json[r'items'] = this.items;
if (this.nextCursor != null) { if (this.nextCursor != null) {
json[r'nextCursor'] = this.nextCursor!.toUtc().toIso8601String(); json[r'nextCursor'] = this.nextCursor;
} else { } else {
// json[r'nextCursor'] = null; // json[r'nextCursor'] = null;
} }
@@ -62,7 +62,7 @@ class IntegrityReportResponseDto {
return IntegrityReportResponseDto( return IntegrityReportResponseDto(
items: IntegrityReportDto.listFromJson(json[r'items']), items: IntegrityReportDto.listFromJson(json[r'items']),
nextCursor: mapDateTime(json, r'nextCursor', r''), nextCursor: mapValueOfType<String>(json, r'nextCursor'),
); );
} }
return null; return null;

View File

@@ -15,36 +15,36 @@ class IntegrityReportSummaryResponseDto {
IntegrityReportSummaryResponseDto({ IntegrityReportSummaryResponseDto({
required this.checksumMismatch, required this.checksumMismatch,
required this.missingFile, required this.missingFile,
required this.orphanFile, required this.untrackedFile,
}); });
int checksumMismatch; int checksumMismatch;
int missingFile; int missingFile;
int orphanFile; int untrackedFile;
@override @override
bool operator ==(Object other) => identical(this, other) || other is IntegrityReportSummaryResponseDto && bool operator ==(Object other) => identical(this, other) || other is IntegrityReportSummaryResponseDto &&
other.checksumMismatch == checksumMismatch && other.checksumMismatch == checksumMismatch &&
other.missingFile == missingFile && other.missingFile == missingFile &&
other.orphanFile == orphanFile; other.untrackedFile == untrackedFile;
@override @override
int get hashCode => int get hashCode =>
// ignore: unnecessary_parenthesis // ignore: unnecessary_parenthesis
(checksumMismatch.hashCode) + (checksumMismatch.hashCode) +
(missingFile.hashCode) + (missingFile.hashCode) +
(orphanFile.hashCode); (untrackedFile.hashCode);
@override @override
String toString() => 'IntegrityReportSummaryResponseDto[checksumMismatch=$checksumMismatch, missingFile=$missingFile, orphanFile=$orphanFile]'; String toString() => 'IntegrityReportSummaryResponseDto[checksumMismatch=$checksumMismatch, missingFile=$missingFile, untrackedFile=$untrackedFile]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'checksum_mismatch'] = this.checksumMismatch; json[r'checksum_mismatch'] = this.checksumMismatch;
json[r'missing_file'] = this.missingFile; json[r'missing_file'] = this.missingFile;
json[r'orphan_file'] = this.orphanFile; json[r'untracked_file'] = this.untrackedFile;
return json; return json;
} }
@@ -59,7 +59,7 @@ class IntegrityReportSummaryResponseDto {
return IntegrityReportSummaryResponseDto( return IntegrityReportSummaryResponseDto(
checksumMismatch: mapValueOfType<int>(json, r'checksum_mismatch')!, checksumMismatch: mapValueOfType<int>(json, r'checksum_mismatch')!,
missingFile: mapValueOfType<int>(json, r'missing_file')!, missingFile: mapValueOfType<int>(json, r'missing_file')!,
orphanFile: mapValueOfType<int>(json, r'orphan_file')!, untrackedFile: mapValueOfType<int>(json, r'untracked_file')!,
); );
} }
return null; return null;
@@ -109,7 +109,7 @@ class IntegrityReportSummaryResponseDto {
static const requiredKeys = <String>{ static const requiredKeys = <String>{
'checksum_mismatch', 'checksum_mismatch',
'missing_file', 'missing_file',
'orphan_file', 'untracked_file',
}; };
} }

View File

@@ -23,13 +23,13 @@ class IntegrityReportType {
String toJson() => value; String toJson() => value;
static const orphanFile = IntegrityReportType._(r'orphan_file'); static const untrackedFile = IntegrityReportType._(r'untracked_file');
static const missingFile = IntegrityReportType._(r'missing_file'); static const missingFile = IntegrityReportType._(r'missing_file');
static const checksumMismatch = IntegrityReportType._(r'checksum_mismatch'); static const checksumMismatch = IntegrityReportType._(r'checksum_mismatch');
/// List of all possible values in this [enum][IntegrityReportType]. /// List of all possible values in this [enum][IntegrityReportType].
static const values = <IntegrityReportType>[ static const values = <IntegrityReportType>[
orphanFile, untrackedFile,
missingFile, missingFile,
checksumMismatch, checksumMismatch,
]; ];
@@ -70,7 +70,7 @@ class IntegrityReportTypeTypeTransformer {
IntegrityReportType? decode(dynamic data, {bool allowNull = true}) { IntegrityReportType? decode(dynamic data, {bool allowNull = true}) {
if (data != null) { if (data != null) {
switch (data) { switch (data) {
case r'orphan_file': return IntegrityReportType.orphanFile; case r'untracked_file': return IntegrityReportType.untrackedFile;
case r'missing_file': return IntegrityReportType.missingFile; case r'missing_file': return IntegrityReportType.missingFile;
case r'checksum_mismatch': return IntegrityReportType.checksumMismatch; case r'checksum_mismatch': return IntegrityReportType.checksumMismatch;
default: default:

View File

@@ -78,9 +78,9 @@ class JobName {
static const ocrQueueAll = JobName._(r'OcrQueueAll'); static const ocrQueueAll = JobName._(r'OcrQueueAll');
static const ocr = JobName._(r'Ocr'); static const ocr = JobName._(r'Ocr');
static const workflowRun = JobName._(r'WorkflowRun'); static const workflowRun = JobName._(r'WorkflowRun');
static const integrityOrphanedFilesQueueAll = JobName._(r'IntegrityOrphanedFilesQueueAll'); static const integrityUntrackedFilesQueueAll = JobName._(r'IntegrityUntrackedFilesQueueAll');
static const integrityOrphanedFiles = JobName._(r'IntegrityOrphanedFiles'); static const integrityUntrackedFiles = JobName._(r'IntegrityUntrackedFiles');
static const integrityOrphanedRefresh = JobName._(r'IntegrityOrphanedRefresh'); static const integrityUntrackedRefresh = JobName._(r'IntegrityUntrackedRefresh');
static const integrityMissingFilesQueueAll = JobName._(r'IntegrityMissingFilesQueueAll'); static const integrityMissingFilesQueueAll = JobName._(r'IntegrityMissingFilesQueueAll');
static const integrityMissingFiles = JobName._(r'IntegrityMissingFiles'); static const integrityMissingFiles = JobName._(r'IntegrityMissingFiles');
static const integrityMissingFilesRefresh = JobName._(r'IntegrityMissingFilesRefresh'); static const integrityMissingFilesRefresh = JobName._(r'IntegrityMissingFilesRefresh');
@@ -146,9 +146,9 @@ class JobName {
ocrQueueAll, ocrQueueAll,
ocr, ocr,
workflowRun, workflowRun,
integrityOrphanedFilesQueueAll, integrityUntrackedFilesQueueAll,
integrityOrphanedFiles, integrityUntrackedFiles,
integrityOrphanedRefresh, integrityUntrackedRefresh,
integrityMissingFilesQueueAll, integrityMissingFilesQueueAll,
integrityMissingFiles, integrityMissingFiles,
integrityMissingFilesRefresh, integrityMissingFilesRefresh,
@@ -249,9 +249,9 @@ class JobNameTypeTransformer {
case r'OcrQueueAll': return JobName.ocrQueueAll; case r'OcrQueueAll': return JobName.ocrQueueAll;
case r'Ocr': return JobName.ocr; case r'Ocr': return JobName.ocr;
case r'WorkflowRun': return JobName.workflowRun; case r'WorkflowRun': return JobName.workflowRun;
case r'IntegrityOrphanedFilesQueueAll': return JobName.integrityOrphanedFilesQueueAll; case r'IntegrityUntrackedFilesQueueAll': return JobName.integrityUntrackedFilesQueueAll;
case r'IntegrityOrphanedFiles': return JobName.integrityOrphanedFiles; case r'IntegrityUntrackedFiles': return JobName.integrityUntrackedFiles;
case r'IntegrityOrphanedRefresh': return JobName.integrityOrphanedRefresh; case r'IntegrityUntrackedRefresh': return JobName.integrityUntrackedRefresh;
case r'IntegrityMissingFilesQueueAll': return JobName.integrityMissingFilesQueueAll; case r'IntegrityMissingFilesQueueAll': return JobName.integrityMissingFilesQueueAll;
case r'IntegrityMissingFiles': return JobName.integrityMissingFiles; case r'IntegrityMissingFiles': return JobName.integrityMissingFiles;
case r'IntegrityMissingFilesRefresh': return JobName.integrityMissingFilesRefresh; case r'IntegrityMissingFilesRefresh': return JobName.integrityMissingFilesRefresh;

View File

@@ -30,13 +30,13 @@ class ManualJobName {
static const memoryCreate = ManualJobName._(r'memory-create'); static const memoryCreate = ManualJobName._(r'memory-create');
static const backupDatabase = ManualJobName._(r'backup-database'); static const backupDatabase = ManualJobName._(r'backup-database');
static const integrityMissingFiles = ManualJobName._(r'integrity-missing-files'); static const integrityMissingFiles = ManualJobName._(r'integrity-missing-files');
static const integrityOrphanFiles = ManualJobName._(r'integrity-orphan-files'); static const integrityUntrackedFiles = ManualJobName._(r'integrity-untracked-files');
static const integrityChecksumMismatch = ManualJobName._(r'integrity-checksum-mismatch'); static const integrityChecksumMismatch = ManualJobName._(r'integrity-checksum-mismatch');
static const integrityMissingFilesRefresh = ManualJobName._(r'integrity-missing-files-refresh'); static const integrityMissingFilesRefresh = ManualJobName._(r'integrity-missing-files-refresh');
static const integrityOrphanFilesRefresh = ManualJobName._(r'integrity-orphan-files-refresh'); static const integrityUntrackedFilesRefresh = ManualJobName._(r'integrity-untracked-files-refresh');
static const integrityChecksumMismatchRefresh = ManualJobName._(r'integrity-checksum-mismatch-refresh'); static const integrityChecksumMismatchRefresh = ManualJobName._(r'integrity-checksum-mismatch-refresh');
static const integrityMissingFilesDeleteAll = ManualJobName._(r'integrity-missing-files-delete-all'); static const integrityMissingFilesDeleteAll = ManualJobName._(r'integrity-missing-files-delete-all');
static const integrityOrphanFilesDeleteAll = ManualJobName._(r'integrity-orphan-files-delete-all'); static const integrityUntrackedFilesDeleteAll = ManualJobName._(r'integrity-untracked-files-delete-all');
static const integrityChecksumMismatchDeleteAll = ManualJobName._(r'integrity-checksum-mismatch-delete-all'); static const integrityChecksumMismatchDeleteAll = ManualJobName._(r'integrity-checksum-mismatch-delete-all');
/// List of all possible values in this [enum][ManualJobName]. /// List of all possible values in this [enum][ManualJobName].
@@ -48,13 +48,13 @@ class ManualJobName {
memoryCreate, memoryCreate,
backupDatabase, backupDatabase,
integrityMissingFiles, integrityMissingFiles,
integrityOrphanFiles, integrityUntrackedFiles,
integrityChecksumMismatch, integrityChecksumMismatch,
integrityMissingFilesRefresh, integrityMissingFilesRefresh,
integrityOrphanFilesRefresh, integrityUntrackedFilesRefresh,
integrityChecksumMismatchRefresh, integrityChecksumMismatchRefresh,
integrityMissingFilesDeleteAll, integrityMissingFilesDeleteAll,
integrityOrphanFilesDeleteAll, integrityUntrackedFilesDeleteAll,
integrityChecksumMismatchDeleteAll, integrityChecksumMismatchDeleteAll,
]; ];
@@ -101,13 +101,13 @@ class ManualJobNameTypeTransformer {
case r'memory-create': return ManualJobName.memoryCreate; case r'memory-create': return ManualJobName.memoryCreate;
case r'backup-database': return ManualJobName.backupDatabase; case r'backup-database': return ManualJobName.backupDatabase;
case r'integrity-missing-files': return ManualJobName.integrityMissingFiles; case r'integrity-missing-files': return ManualJobName.integrityMissingFiles;
case r'integrity-orphan-files': return ManualJobName.integrityOrphanFiles; case r'integrity-untracked-files': return ManualJobName.integrityUntrackedFiles;
case r'integrity-checksum-mismatch': return ManualJobName.integrityChecksumMismatch; case r'integrity-checksum-mismatch': return ManualJobName.integrityChecksumMismatch;
case r'integrity-missing-files-refresh': return ManualJobName.integrityMissingFilesRefresh; case r'integrity-missing-files-refresh': return ManualJobName.integrityMissingFilesRefresh;
case r'integrity-orphan-files-refresh': return ManualJobName.integrityOrphanFilesRefresh; case r'integrity-untracked-files-refresh': return ManualJobName.integrityUntrackedFilesRefresh;
case r'integrity-checksum-mismatch-refresh': return ManualJobName.integrityChecksumMismatchRefresh; case r'integrity-checksum-mismatch-refresh': return ManualJobName.integrityChecksumMismatchRefresh;
case r'integrity-missing-files-delete-all': return ManualJobName.integrityMissingFilesDeleteAll; case r'integrity-missing-files-delete-all': return ManualJobName.integrityMissingFilesDeleteAll;
case r'integrity-orphan-files-delete-all': return ManualJobName.integrityOrphanFilesDeleteAll; case r'integrity-untracked-files-delete-all': return ManualJobName.integrityUntrackedFilesDeleteAll;
case r'integrity-checksum-mismatch-delete-all': return ManualJobName.integrityChecksumMismatchDeleteAll; case r'integrity-checksum-mismatch-delete-all': return ManualJobName.integrityChecksumMismatchDeleteAll;
default: default:
if (!allowNull) { if (!allowNull) {

View File

@@ -15,36 +15,36 @@ class SystemConfigIntegrityChecks {
SystemConfigIntegrityChecks({ SystemConfigIntegrityChecks({
required this.checksumFiles, required this.checksumFiles,
required this.missingFiles, required this.missingFiles,
required this.orphanedFiles, required this.untrackedFiles,
}); });
SystemConfigIntegrityChecksumJob checksumFiles; SystemConfigIntegrityChecksumJob checksumFiles;
SystemConfigIntegrityJob missingFiles; SystemConfigIntegrityJob missingFiles;
SystemConfigIntegrityJob orphanedFiles; SystemConfigIntegrityJob untrackedFiles;
@override @override
bool operator ==(Object other) => identical(this, other) || other is SystemConfigIntegrityChecks && bool operator ==(Object other) => identical(this, other) || other is SystemConfigIntegrityChecks &&
other.checksumFiles == checksumFiles && other.checksumFiles == checksumFiles &&
other.missingFiles == missingFiles && other.missingFiles == missingFiles &&
other.orphanedFiles == orphanedFiles; other.untrackedFiles == untrackedFiles;
@override @override
int get hashCode => int get hashCode =>
// ignore: unnecessary_parenthesis // ignore: unnecessary_parenthesis
(checksumFiles.hashCode) + (checksumFiles.hashCode) +
(missingFiles.hashCode) + (missingFiles.hashCode) +
(orphanedFiles.hashCode); (untrackedFiles.hashCode);
@override @override
String toString() => 'SystemConfigIntegrityChecks[checksumFiles=$checksumFiles, missingFiles=$missingFiles, orphanedFiles=$orphanedFiles]'; String toString() => 'SystemConfigIntegrityChecks[checksumFiles=$checksumFiles, missingFiles=$missingFiles, untrackedFiles=$untrackedFiles]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'checksumFiles'] = this.checksumFiles; json[r'checksumFiles'] = this.checksumFiles;
json[r'missingFiles'] = this.missingFiles; json[r'missingFiles'] = this.missingFiles;
json[r'orphanedFiles'] = this.orphanedFiles; json[r'untrackedFiles'] = this.untrackedFiles;
return json; return json;
} }
@@ -59,7 +59,7 @@ class SystemConfigIntegrityChecks {
return SystemConfigIntegrityChecks( return SystemConfigIntegrityChecks(
checksumFiles: SystemConfigIntegrityChecksumJob.fromJson(json[r'checksumFiles'])!, checksumFiles: SystemConfigIntegrityChecksumJob.fromJson(json[r'checksumFiles'])!,
missingFiles: SystemConfigIntegrityJob.fromJson(json[r'missingFiles'])!, missingFiles: SystemConfigIntegrityJob.fromJson(json[r'missingFiles'])!,
orphanedFiles: SystemConfigIntegrityJob.fromJson(json[r'orphanedFiles'])!, untrackedFiles: SystemConfigIntegrityJob.fromJson(json[r'untrackedFiles'])!,
); );
} }
return null; return null;
@@ -109,7 +109,7 @@ class SystemConfigIntegrityChecks {
static const requiredKeys = <String>{ static const requiredKeys = <String>{
'checksumFiles', 'checksumFiles',
'missingFiles', 'missingFiles',
'orphanedFiles', 'untrackedFiles',
}; };
} }

View File

@@ -431,7 +431,7 @@
}, },
"/admin/integrity/report/{id}/file": { "/admin/integrity/report/{id}/file": {
"get": { "get": {
"description": "Download the orphan/broken file if one exists", "description": "Download the untracked/broken file if one exists",
"operationId": "getIntegrityReportFile", "operationId": "getIntegrityReportFile",
"parameters": [ "parameters": [
{ {
@@ -16997,20 +16997,20 @@
"missing_file": { "missing_file": {
"type": "integer" "type": "integer"
}, },
"orphan_file": { "untracked_file": {
"type": "integer" "type": "integer"
} }
}, },
"required": [ "required": [
"checksum_mismatch", "checksum_mismatch",
"missing_file", "missing_file",
"orphan_file" "untracked_file"
], ],
"type": "object" "type": "object"
}, },
"IntegrityReportType": { "IntegrityReportType": {
"enum": [ "enum": [
"orphan_file", "untracked_file",
"missing_file", "missing_file",
"checksum_mismatch" "checksum_mismatch"
], ],
@@ -17088,9 +17088,9 @@
"OcrQueueAll", "OcrQueueAll",
"Ocr", "Ocr",
"WorkflowRun", "WorkflowRun",
"IntegrityOrphanedFilesQueueAll", "IntegrityUntrackedFilesQueueAll",
"IntegrityOrphanedFiles", "IntegrityUntrackedFiles",
"IntegrityOrphanedRefresh", "IntegrityUntrackedRefresh",
"IntegrityMissingFilesQueueAll", "IntegrityMissingFilesQueueAll",
"IntegrityMissingFiles", "IntegrityMissingFiles",
"IntegrityMissingFilesRefresh", "IntegrityMissingFilesRefresh",
@@ -17368,13 +17368,13 @@
"memory-create", "memory-create",
"backup-database", "backup-database",
"integrity-missing-files", "integrity-missing-files",
"integrity-orphan-files", "integrity-untracked-files",
"integrity-checksum-mismatch", "integrity-checksum-mismatch",
"integrity-missing-files-refresh", "integrity-missing-files-refresh",
"integrity-orphan-files-refresh", "integrity-untracked-files-refresh",
"integrity-checksum-mismatch-refresh", "integrity-checksum-mismatch-refresh",
"integrity-missing-files-delete-all", "integrity-missing-files-delete-all",
"integrity-orphan-files-delete-all", "integrity-untracked-files-delete-all",
"integrity-checksum-mismatch-delete-all" "integrity-checksum-mismatch-delete-all"
], ],
"type": "string" "type": "string"
@@ -22022,14 +22022,14 @@
"missingFiles": { "missingFiles": {
"$ref": "#/components/schemas/SystemConfigIntegrityJob" "$ref": "#/components/schemas/SystemConfigIntegrityJob"
}, },
"orphanedFiles": { "untrackedFiles": {
"$ref": "#/components/schemas/SystemConfigIntegrityJob" "$ref": "#/components/schemas/SystemConfigIntegrityJob"
} }
}, },
"required": [ "required": [
"checksumFiles", "checksumFiles",
"missingFiles", "missingFiles",
"orphanedFiles" "untrackedFiles"
], ],
"type": "object" "type": "object"
}, },

View File

@@ -8,7 +8,7 @@ import * as Oazapfts from "@oazapfts/runtime";
import * as QS from "@oazapfts/runtime/query"; import * as QS from "@oazapfts/runtime/query";
export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = { export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
headers: {}, headers: {},
baseUrl: "/api", baseUrl: "/api"
}; };
const oazapfts = Oazapfts.runtime(defaults); const oazapfts = Oazapfts.runtime(defaults);
export const servers = { export const servers = {
@@ -57,7 +57,7 @@ export type IntegrityReportResponseDto = {
export type IntegrityReportSummaryResponseDto = { export type IntegrityReportSummaryResponseDto = {
checksum_mismatch: number; checksum_mismatch: number;
missing_file: number; missing_file: number;
orphan_file: number; untracked_file: number;
}; };
export type SetMaintenanceModeDto = { export type SetMaintenanceModeDto = {
action: MaintenanceAction; action: MaintenanceAction;
@@ -1491,7 +1491,7 @@ export type SystemConfigIntegrityJob = {
export type SystemConfigIntegrityChecks = { export type SystemConfigIntegrityChecks = {
checksumFiles: SystemConfigIntegrityChecksumJob; checksumFiles: SystemConfigIntegrityChecksumJob;
missingFiles: SystemConfigIntegrityJob; missingFiles: SystemConfigIntegrityJob;
orphanedFiles: SystemConfigIntegrityJob; untrackedFiles: SystemConfigIntegrityJob;
}; };
export type JobSettingsDto = { export type JobSettingsDto = {
concurrency: number; concurrency: number;
@@ -5257,7 +5257,7 @@ export enum UserAvatarColor {
Amber = "amber" Amber = "amber"
} }
export enum IntegrityReportType { export enum IntegrityReportType {
OrphanFile = "orphan_file", UntrackedFile = "untracked_file",
MissingFile = "missing_file", MissingFile = "missing_file",
ChecksumMismatch = "checksum_mismatch" ChecksumMismatch = "checksum_mismatch"
} }
@@ -5503,13 +5503,13 @@ export enum ManualJobName {
MemoryCreate = "memory-create", MemoryCreate = "memory-create",
BackupDatabase = "backup-database", BackupDatabase = "backup-database",
IntegrityMissingFiles = "integrity-missing-files", IntegrityMissingFiles = "integrity-missing-files",
IntegrityOrphanFiles = "integrity-orphan-files", IntegrityUntrackedFiles = "integrity-untracked-files",
IntegrityChecksumMismatch = "integrity-checksum-mismatch", IntegrityChecksumMismatch = "integrity-checksum-mismatch",
IntegrityMissingFilesRefresh = "integrity-missing-files-refresh", IntegrityMissingFilesRefresh = "integrity-missing-files-refresh",
IntegrityOrphanFilesRefresh = "integrity-orphan-files-refresh", IntegrityUntrackedFilesRefresh = "integrity-untracked-files-refresh",
IntegrityChecksumMismatchRefresh = "integrity-checksum-mismatch-refresh", IntegrityChecksumMismatchRefresh = "integrity-checksum-mismatch-refresh",
IntegrityMissingFilesDeleteAll = "integrity-missing-files-delete-all", IntegrityMissingFilesDeleteAll = "integrity-missing-files-delete-all",
IntegrityOrphanFilesDeleteAll = "integrity-orphan-files-delete-all", IntegrityUntrackedFilesDeleteAll = "integrity-untracked-files-delete-all",
IntegrityChecksumMismatchDeleteAll = "integrity-checksum-mismatch-delete-all" IntegrityChecksumMismatchDeleteAll = "integrity-checksum-mismatch-delete-all"
} }
export enum QueueName { export enum QueueName {
@@ -5624,9 +5624,9 @@ export enum JobName {
OcrQueueAll = "OcrQueueAll", OcrQueueAll = "OcrQueueAll",
Ocr = "Ocr", Ocr = "Ocr",
WorkflowRun = "WorkflowRun", WorkflowRun = "WorkflowRun",
IntegrityOrphanedFilesQueueAll = "IntegrityOrphanedFilesQueueAll", IntegrityUntrackedFilesQueueAll = "IntegrityUntrackedFilesQueueAll",
IntegrityOrphanedFiles = "IntegrityOrphanedFiles", IntegrityUntrackedFiles = "IntegrityUntrackedFiles",
IntegrityOrphanedRefresh = "IntegrityOrphanedRefresh", IntegrityUntrackedRefresh = "IntegrityUntrackedRefresh",
IntegrityMissingFilesQueueAll = "IntegrityMissingFilesQueueAll", IntegrityMissingFilesQueueAll = "IntegrityMissingFilesQueueAll",
IntegrityMissingFiles = "IntegrityMissingFiles", IntegrityMissingFiles = "IntegrityMissingFiles",
IntegrityMissingFilesRefresh = "IntegrityMissingFilesRefresh", IntegrityMissingFilesRefresh = "IntegrityMissingFilesRefresh",

View File

@@ -51,7 +51,7 @@ export interface SystemConfig {
enabled: boolean; enabled: boolean;
cronExpression: string; cronExpression: string;
}; };
orphanedFiles: { untrackedFiles: {
enabled: boolean; enabled: boolean;
cronExpression: string; cronExpression: string;
}; };
@@ -243,7 +243,7 @@ export const defaults = Object.freeze<SystemConfig>({
enabled: true, enabled: true,
cronExpression: CronExpression.EVERY_DAY_AT_3AM, cronExpression: CronExpression.EVERY_DAY_AT_3AM,
}, },
orphanedFiles: { untrackedFiles: {
enabled: true, enabled: true,
cronExpression: CronExpression.EVERY_DAY_AT_3AM, cronExpression: CronExpression.EVERY_DAY_AT_3AM,
}, },

View File

@@ -76,7 +76,7 @@ export class IntegrityController {
@Get('report/:id/file') @Get('report/:id/file')
@Endpoint({ @Endpoint({
summary: 'Download flagged file', summary: 'Download flagged file',
description: 'Download the orphan/broken file if one exists', description: 'Download the untracked/broken file if one exists',
history: new HistoryBuilder().added('v9.9.9').alpha('v9.9.9'), history: new HistoryBuilder().added('v9.9.9').alpha('v9.9.9'),
}) })
@FileResponse() @FileResponse()

View File

@@ -10,7 +10,7 @@ export class IntegrityReportSummaryResponseDto {
@ApiProperty({ type: 'integer' }) @ApiProperty({ type: 'integer' })
[IntegrityReportType.MissingFile]!: number; [IntegrityReportType.MissingFile]!: number;
@ApiProperty({ type: 'integer' }) @ApiProperty({ type: 'integer' })
[IntegrityReportType.OrphanFile]!: number; [IntegrityReportType.UntrackedFile]!: number;
} }
export class IntegrityGetReportDto { export class IntegrityGetReportDto {

View File

@@ -174,7 +174,7 @@ class SystemConfigIntegrityChecks {
@Type(() => SystemConfigIntegrityJob) @Type(() => SystemConfigIntegrityJob)
@ValidateNested() @ValidateNested()
@IsObject() @IsObject()
orphanedFiles!: SystemConfigIntegrityJob; untrackedFiles!: SystemConfigIntegrityJob;
@Type(() => SystemConfigIntegrityChecksumJob) @Type(() => SystemConfigIntegrityChecksumJob)
@ValidateNested() @ValidateNested()

View File

@@ -347,7 +347,7 @@ export enum SourceType {
} }
export enum IntegrityReportType { export enum IntegrityReportType {
OrphanFile = 'orphan_file', UntrackedFile = 'untracked_file',
MissingFile = 'missing_file', MissingFile = 'missing_file',
ChecksumFail = 'checksum_mismatch', ChecksumFail = 'checksum_mismatch',
} }
@@ -360,13 +360,13 @@ export enum ManualJobName {
MemoryCreate = 'memory-create', MemoryCreate = 'memory-create',
BackupDatabase = 'backup-database', BackupDatabase = 'backup-database',
IntegrityMissingFiles = `integrity-missing-files`, IntegrityMissingFiles = `integrity-missing-files`,
IntegrityOrphanFiles = `integrity-orphan-files`, IntegrityUntrackedFiles = `integrity-untracked-files`,
IntegrityChecksumFiles = `integrity-checksum-mismatch`, IntegrityChecksumFiles = `integrity-checksum-mismatch`,
IntegrityMissingFilesRefresh = `integrity-missing-files-refresh`, IntegrityMissingFilesRefresh = `integrity-missing-files-refresh`,
IntegrityOrphanFilesRefresh = `integrity-orphan-files-refresh`, IntegrityUntrackedFilesRefresh = `integrity-untracked-files-refresh`,
IntegrityChecksumFilesRefresh = `integrity-checksum-mismatch-refresh`, IntegrityChecksumFilesRefresh = `integrity-checksum-mismatch-refresh`,
IntegrityMissingFilesDeleteAll = `integrity-missing-files-delete-all`, IntegrityMissingFilesDeleteAll = `integrity-missing-files-delete-all`,
IntegrityOrphanFilesDeleteAll = `integrity-orphan-files-delete-all`, IntegrityUntrackedFilesDeleteAll = `integrity-untracked-files-delete-all`,
IntegrityChecksumFilesDeleteAll = `integrity-checksum-mismatch-delete-all`, IntegrityChecksumFilesDeleteAll = `integrity-checksum-mismatch-delete-all`,
} }
@@ -662,9 +662,9 @@ export enum JobName {
WorkflowRun = 'WorkflowRun', WorkflowRun = 'WorkflowRun',
// Integrity // Integrity
IntegrityOrphanedFilesQueueAll = 'IntegrityOrphanedFilesQueueAll', IntegrityUntrackedFilesQueueAll = 'IntegrityUntrackedFilesQueueAll',
IntegrityOrphanedFiles = 'IntegrityOrphanedFiles', IntegrityUntrackedFiles = 'IntegrityUntrackedFiles',
IntegrityOrphanedFilesRefresh = 'IntegrityOrphanedRefresh', IntegrityUntrackedFilesRefresh = 'IntegrityUntrackedRefresh',
IntegrityMissingFilesQueueAll = 'IntegrityMissingFilesQueueAll', IntegrityMissingFilesQueueAll = 'IntegrityMissingFilesQueueAll',
IntegrityMissingFiles = 'IntegrityMissingFiles', IntegrityMissingFiles = 'IntegrityMissingFiles',
IntegrityMissingFilesRefresh = 'IntegrityMissingFilesRefresh', IntegrityMissingFilesRefresh = 'IntegrityMissingFilesRefresh',

View File

@@ -21,7 +21,7 @@ select
count(*) filter ( count(*) filter (
where where
"type" = $3 "type" = $3
) as "orphan_file" ) as "untracked_file"
from from
"integrity_report" "integrity_report"

View File

@@ -57,8 +57,8 @@ export class IntegrityRepository {
.select((eb) => .select((eb) =>
eb.fn eb.fn
.countAll<number>() .countAll<number>()
.filterWhere('type', '=', IntegrityReportType.OrphanFile) .filterWhere('type', '=', IntegrityReportType.UntrackedFile)
.as(IntegrityReportType.OrphanFile), .as(IntegrityReportType.UntrackedFile),
) )
.executeTakeFirstOrThrow(); .executeTakeFirstOrThrow();
} }
@@ -149,7 +149,7 @@ export class IntegrityRepository {
) )
.leftJoin('integrity_report', (join) => .leftJoin('integrity_report', (join) =>
join join
.on('integrity_report.type', '=', IntegrityReportType.OrphanFile) .on('integrity_report.type', '=', IntegrityReportType.UntrackedFile)
.on((eb) => .on((eb) =>
eb.or([ eb.or([
eb('integrity_report.assetId', '=', eb.ref('allPaths.assetId')), eb('integrity_report.assetId', '=', eb.ref('allPaths.assetId')),

View File

@@ -145,7 +145,7 @@ describe(IntegrityService.name, () => {
expect(mocks.asset.deleteFiles).toHaveBeenCalledWith([{ id: 'fileAssetId' }]); expect(mocks.asset.deleteFiles).toHaveBeenCalledWith([{ id: 'fileAssetId' }]);
}); });
it('deletes orphaned file', async () => { it('deletes untracked file', async () => {
mocks.integrityReport.getById.mockResolvedValue({ mocks.integrityReport.getById.mockResolvedValue({
id: 'id', id: 'id',
createdAt: new Date(0), createdAt: new Date(0),
@@ -169,7 +169,7 @@ describe(IntegrityService.name, () => {
}); });
}); });
describe('handleOrphanedFilesQueueAll', () => { describe('handleUntrackedFilesQueueAll', () => {
beforeEach(() => { beforeEach(() => {
mocks.integrityReport.streamIntegrityReportsWithAssetChecksum.mockReturnValue((function* () {})() as never); mocks.integrityReport.streamIntegrityReportsWithAssetChecksum.mockReturnValue((function* () {})() as never);
}); });
@@ -189,11 +189,11 @@ describe(IntegrityService.name, () => {
})() as never, })() as never,
); );
await sut.handleOrphanedFilesQueueAll({ refreshOnly: false }); await sut.handleUntrackedFilesQueueAll({ refreshOnly: false });
expect(mocks.job.queue).toBeCalledTimes(4); expect(mocks.job.queue).toBeCalledTimes(4);
expect(mocks.job.queue).toBeCalledWith({ expect(mocks.job.queue).toBeCalledWith({
name: JobName.IntegrityOrphanedFiles, name: JobName.IntegrityUntrackedFiles,
data: { data: {
type: 'asset', type: 'asset',
paths: expect.arrayContaining(['/path/to/file']), paths: expect.arrayContaining(['/path/to/file']),
@@ -201,7 +201,7 @@ describe(IntegrityService.name, () => {
}); });
expect(mocks.job.queue).toBeCalledWith({ expect(mocks.job.queue).toBeCalledWith({
name: JobName.IntegrityOrphanedFiles, name: JobName.IntegrityUntrackedFiles,
data: { data: {
type: 'asset_file', type: 'asset_file',
paths: expect.arrayContaining(['/path/to/file3']), paths: expect.arrayContaining(['/path/to/file3']),
@@ -216,11 +216,11 @@ describe(IntegrityService.name, () => {
})() as never, })() as never,
); );
await sut.handleOrphanedFilesQueueAll({ refreshOnly: false }); await sut.handleUntrackedFilesQueueAll({ refreshOnly: false });
expect(mocks.job.queue).toBeCalledTimes(1); expect(mocks.job.queue).toBeCalledTimes(1);
expect(mocks.job.queue).toBeCalledWith({ expect(mocks.job.queue).toBeCalledWith({
name: JobName.IntegrityOrphanedFilesRefresh, name: JobName.IntegrityUntrackedFilesRefresh,
data: { data: {
items: expect.arrayContaining(['mockReport']), items: expect.arrayContaining(['mockReport']),
}, },
@@ -228,33 +228,33 @@ describe(IntegrityService.name, () => {
}); });
it('should succeed', async () => { it('should succeed', async () => {
await expect(sut.handleOrphanedFilesQueueAll({ refreshOnly: false })).resolves.toBe(JobStatus.Success); await expect(sut.handleUntrackedFilesQueueAll({ refreshOnly: false })).resolves.toBe(JobStatus.Success);
}); });
}); });
describe('handleOrphanedFiles', () => { describe('handleUntrackedFiles', () => {
it('should detect orphaned asset files', async () => { it('should detect untracked asset files', async () => {
mocks.integrityReport.getAssetPathsByPaths.mockResolvedValue([ mocks.integrityReport.getAssetPathsByPaths.mockResolvedValue([
{ originalPath: '/path/to/file1', encodedVideoPath: null }, { originalPath: '/path/to/file1', encodedVideoPath: null },
]); ]);
await sut.handleOrphanedFiles({ await sut.handleUntrackedFiles({
type: 'asset', type: 'asset',
paths: ['/path/to/file1', '/path/to/orphan'], paths: ['/path/to/file1', '/path/to/untracked'],
}); });
expect(mocks.integrityReport.getAssetPathsByPaths).toHaveBeenCalledWith(['/path/to/file1', '/path/to/orphan']); expect(mocks.integrityReport.getAssetPathsByPaths).toHaveBeenCalledWith(['/path/to/file1', '/path/to/untracked']);
expect(mocks.integrityReport.create).toHaveBeenCalledWith([ expect(mocks.integrityReport.create).toHaveBeenCalledWith([
{ type: IntegrityReportType.OrphanFile, path: '/path/to/orphan' }, { type: IntegrityReportType.UntrackedFile, path: '/path/to/untracked' },
]); ]);
}); });
it('should not create reports when no orphans found for assets', async () => { it('should not create reports when no untracked files found for assets', async () => {
mocks.integrityReport.getAssetPathsByPaths.mockResolvedValue([ mocks.integrityReport.getAssetPathsByPaths.mockResolvedValue([
{ originalPath: '/path/to/file1', encodedVideoPath: '/path/to/encoded' }, { originalPath: '/path/to/file1', encodedVideoPath: '/path/to/encoded' },
]); ]);
await sut.handleOrphanedFiles({ await sut.handleUntrackedFiles({
type: 'asset', type: 'asset',
paths: ['/path/to/file1', '/path/to/encoded'], paths: ['/path/to/file1', '/path/to/encoded'],
}); });
@@ -262,28 +262,28 @@ describe(IntegrityService.name, () => {
expect(mocks.integrityReport.create).not.toHaveBeenCalled(); expect(mocks.integrityReport.create).not.toHaveBeenCalled();
}); });
it('should detect orphaned asset_file files', async () => { it('should detect untracked asset_file files', async () => {
mocks.integrityReport.getAssetFilePathsByPaths.mockResolvedValue([{ path: '/path/to/thumb1' }]); mocks.integrityReport.getAssetFilePathsByPaths.mockResolvedValue([{ path: '/path/to/thumb1' }]);
await sut.handleOrphanedFiles({ await sut.handleUntrackedFiles({
type: 'asset_file', type: 'asset_file',
paths: ['/path/to/thumb1', '/path/to/orphan_thumb'], paths: ['/path/to/thumb1', '/path/to/untracked_thumb'],
}); });
expect(mocks.integrityReport.create).toHaveBeenCalledWith([ expect(mocks.integrityReport.create).toHaveBeenCalledWith([
{ type: IntegrityReportType.OrphanFile, path: '/path/to/orphan_thumb' }, { type: IntegrityReportType.UntrackedFile, path: '/path/to/untracked_thumb' },
]); ]);
}); });
}); });
describe('handleOrphanedRefresh', () => { describe('handleUntrackedRefresh', () => {
it('should delete reports for files that no longer exist', async () => { it('should delete reports for files that no longer exist', async () => {
mocks.storage.stat mocks.storage.stat
.mockRejectedValueOnce(new Error('ENOENT')) .mockRejectedValueOnce(new Error('ENOENT'))
.mockResolvedValueOnce({} as never) .mockResolvedValueOnce({} as never)
.mockRejectedValueOnce(new Error('ENOENT')); .mockRejectedValueOnce(new Error('ENOENT'));
await sut.handleOrphanedRefresh({ await sut.handleUntrackedRefresh({
items: [ items: [
{ reportId: 'report1', path: '/path/to/missing1' }, { reportId: 'report1', path: '/path/to/missing1' },
{ reportId: 'report2', path: '/path/to/existing' }, { reportId: 'report2', path: '/path/to/existing' },
@@ -297,7 +297,7 @@ describe(IntegrityService.name, () => {
it('should not delete reports for files that still exist', async () => { it('should not delete reports for files that still exist', async () => {
mocks.storage.stat.mockResolvedValue({} as never); mocks.storage.stat.mockResolvedValue({} as never);
await sut.handleOrphanedRefresh({ await sut.handleUntrackedRefresh({
items: [{ reportId: 'report1', path: '/path/to/existing' }], items: [{ reportId: 'report1', path: '/path/to/existing' }],
}); });
@@ -305,7 +305,7 @@ describe(IntegrityService.name, () => {
}); });
it('should succeed', async () => { it('should succeed', async () => {
await expect(sut.handleOrphanedRefresh({ items: [] })).resolves.toBe(JobStatus.Success); await expect(sut.handleUntrackedRefresh({ items: [] })).resolves.toBe(JobStatus.Success);
}); });
}); });
@@ -604,24 +604,24 @@ describe(IntegrityService.name, () => {
expect(mocks.job.queue).toHaveBeenCalledTimes(2); expect(mocks.job.queue).toHaveBeenCalledTimes(2);
}); });
it('should queue delete jobs for orphan file reports', async () => { it('should queue delete jobs for untracked file reports', async () => {
mocks.integrityReport.streamIntegrityReportsByProperty.mockReturnValue( mocks.integrityReport.streamIntegrityReportsByProperty.mockReturnValue(
(function* () { (function* () {
yield { id: 'report1', path: '/path/to/orphan' }; yield { id: 'report1', path: '/path/to/untracked' };
})() as never, })() as never,
); );
await sut.handleDeleteAllIntegrityReports({ type: IntegrityReportType.OrphanFile }); await sut.handleDeleteAllIntegrityReports({ type: IntegrityReportType.UntrackedFile });
expect(mocks.integrityReport.streamIntegrityReportsByProperty).toHaveBeenCalledWith( expect(mocks.integrityReport.streamIntegrityReportsByProperty).toHaveBeenCalledWith(
undefined, undefined,
IntegrityReportType.OrphanFile, IntegrityReportType.UntrackedFile,
); );
expect(mocks.job.queue).toHaveBeenCalledWith({ expect(mocks.job.queue).toHaveBeenCalledWith({
name: JobName.IntegrityDeleteReports, name: JobName.IntegrityDeleteReports,
data: { data: {
reports: [{ id: 'report1', path: '/path/to/orphan' }], reports: [{ id: 'report1', path: '/path/to/untracked' }],
}, },
}); });
}); });
@@ -648,7 +648,7 @@ describe(IntegrityService.name, () => {
{ id: 'report1', assetId: 'asset1', fileAssetId: null, path: '/path/to/file1' }, { id: 'report1', assetId: 'asset1', fileAssetId: null, path: '/path/to/file1' },
{ id: 'report2', assetId: 'asset2', fileAssetId: null, path: '/path/to/file2' }, { id: 'report2', assetId: 'asset2', fileAssetId: null, path: '/path/to/file2' },
{ id: 'report3', assetId: null, fileAssetId: 'fileAsset1', path: '/path/to/file3' }, { id: 'report3', assetId: null, fileAssetId: 'fileAsset1', path: '/path/to/file3' },
{ id: 'report4', assetId: null, fileAssetId: null, path: '/path/to/orphan' }, { id: 'report4', assetId: null, fileAssetId: null, path: '/path/to/untracked' },
], ],
}); });
@@ -666,7 +666,7 @@ describe(IntegrityService.name, () => {
expect(mocks.asset.deleteFiles).toHaveBeenCalledWith([{ id: 'fileAsset1' }]); expect(mocks.asset.deleteFiles).toHaveBeenCalledWith([{ id: 'fileAsset1' }]);
expect(mocks.storage.unlink).toHaveBeenCalledWith('/path/to/orphan'); expect(mocks.storage.unlink).toHaveBeenCalledWith('/path/to/untracked');
expect(mocks.integrityReport.deleteByIds).toHaveBeenCalledWith(['report4']); expect(mocks.integrityReport.deleteByIds).toHaveBeenCalledWith(['report4']);
}); });

View File

@@ -31,15 +31,15 @@ import {
IIntegrityDeleteReportTypeJob, IIntegrityDeleteReportTypeJob,
IIntegrityJob, IIntegrityJob,
IIntegrityMissingFilesJob, IIntegrityMissingFilesJob,
IIntegrityOrphanedFilesJob,
IIntegrityPathWithChecksumJob, IIntegrityPathWithChecksumJob,
IIntegrityPathWithReportJob, IIntegrityPathWithReportJob,
IIntegrityUntrackedFilesJob,
} from 'src/types'; } from 'src/types';
import { ImmichFileResponse } from 'src/utils/file'; import { ImmichFileResponse } from 'src/utils/file';
import { handlePromiseError } from 'src/utils/misc'; import { handlePromiseError } from 'src/utils/misc';
/** /**
* Orphan Files: * Untracked Files:
* Files are detected in /data/encoded-video, /data/library, /data/upload * Files are detected in /data/encoded-video, /data/library, /data/upload
* Checked against the asset table * Checked against the asset table
* Files are detected in /data/thumbs * Files are detected in /data/thumbs
@@ -69,20 +69,20 @@ export class IntegrityService extends BaseService {
@OnEvent({ name: 'ConfigInit', workers: [ImmichWorker.Microservices] }) @OnEvent({ name: 'ConfigInit', workers: [ImmichWorker.Microservices] })
async onConfigInit({ async onConfigInit({
newConfig: { newConfig: {
integrityChecks: { orphanedFiles, missingFiles, checksumFiles }, integrityChecks: { untrackedFiles, missingFiles, checksumFiles },
}, },
}: ArgOf<'ConfigInit'>) { }: ArgOf<'ConfigInit'>) {
this.integrityLock = await this.databaseRepository.tryLock(DatabaseLock.IntegrityCheck); this.integrityLock = await this.databaseRepository.tryLock(DatabaseLock.IntegrityCheck);
if (this.integrityLock) { if (this.integrityLock) {
this.cronRepository.create({ this.cronRepository.create({
name: 'integrityOrphanedFiles', name: 'integrityUntrackedFiles',
expression: orphanedFiles.cronExpression, expression: untrackedFiles.cronExpression,
onTick: () => onTick: () =>
handlePromiseError( handlePromiseError(
this.jobRepository.queue({ name: JobName.IntegrityOrphanedFilesQueueAll, data: {} }), this.jobRepository.queue({ name: JobName.IntegrityUntrackedFilesQueueAll, data: {} }),
this.logger, this.logger,
), ),
start: orphanedFiles.enabled, start: untrackedFiles.enabled,
}); });
this.cronRepository.create({ this.cronRepository.create({
@@ -109,7 +109,7 @@ export class IntegrityService extends BaseService {
@OnEvent({ name: 'ConfigUpdate', server: true }) @OnEvent({ name: 'ConfigUpdate', server: true })
onConfigUpdate({ onConfigUpdate({
newConfig: { newConfig: {
integrityChecks: { orphanedFiles, missingFiles, checksumFiles }, integrityChecks: { untrackedFiles, missingFiles, checksumFiles },
}, },
}: ArgOf<'ConfigUpdate'>) { }: ArgOf<'ConfigUpdate'>) {
if (!this.integrityLock) { if (!this.integrityLock) {
@@ -117,9 +117,9 @@ export class IntegrityService extends BaseService {
} }
this.cronRepository.update({ this.cronRepository.update({
name: 'integrityOrphanedFiles', name: 'integrityUntrackedFiles',
expression: orphanedFiles.cronExpression, expression: untrackedFiles.cronExpression,
start: orphanedFiles.enabled, start: untrackedFiles.enabled,
}); });
this.cronRepository.update({ this.cronRepository.update({
@@ -194,16 +194,16 @@ export class IntegrityService extends BaseService {
} }
} }
@OnJob({ name: JobName.IntegrityOrphanedFilesQueueAll, queue: QueueName.IntegrityCheck }) @OnJob({ name: JobName.IntegrityUntrackedFilesQueueAll, queue: QueueName.IntegrityCheck })
async handleOrphanedFilesQueueAll({ refreshOnly }: IIntegrityJob = {}): Promise<JobStatus> { async handleUntrackedFilesQueueAll({ refreshOnly }: IIntegrityJob = {}): Promise<JobStatus> {
this.logger.log(`Checking for out of date orphaned file reports...`); this.logger.log(`Checking for out of date untracked file reports...`);
const reports = this.integrityRepository.streamIntegrityReportsWithAssetChecksum(IntegrityReportType.OrphanFile); const reports = this.integrityRepository.streamIntegrityReportsWithAssetChecksum(IntegrityReportType.UntrackedFile);
let total = 0; let total = 0;
for await (const batchReports of chunk(reports, JOBS_LIBRARY_PAGINATION_SIZE)) { for await (const batchReports of chunk(reports, JOBS_LIBRARY_PAGINATION_SIZE)) {
await this.jobRepository.queue({ await this.jobRepository.queue({
name: JobName.IntegrityOrphanedFilesRefresh, name: JobName.IntegrityUntrackedFilesRefresh,
data: { data: {
items: batchReports, items: batchReports,
}, },
@@ -218,7 +218,7 @@ export class IntegrityService extends BaseService {
return JobStatus.Success; return JobStatus.Success;
} }
this.logger.log(`Scanning for orphaned files...`); this.logger.log(`Scanning for untracked files...`);
const assetPaths = this.storageRepository.walk({ const assetPaths = this.storageRepository.walk({
pathsToCrawl: [StorageFolder.EncodedVideo, StorageFolder.Library, StorageFolder.Upload].map((folder) => pathsToCrawl: [StorageFolder.EncodedVideo, StorageFolder.Library, StorageFolder.Upload].map((folder) =>
@@ -247,7 +247,7 @@ export class IntegrityService extends BaseService {
total = 0; total = 0;
for await (const [batchType, batchPaths] of paths()) { for await (const [batchType, batchPaths] of paths()) {
await this.jobRepository.queue({ await this.jobRepository.queue({
name: JobName.IntegrityOrphanedFiles, name: JobName.IntegrityUntrackedFiles,
data: { data: {
type: batchType, type: batchType,
paths: batchPaths, paths: batchPaths,
@@ -257,48 +257,48 @@ export class IntegrityService extends BaseService {
const count = batchPaths.length; const count = batchPaths.length;
total += count; total += count;
this.logger.log(`Queued orphan check of ${count} file(s) (${total} so far)`); this.logger.log(`Queued untracked check of ${count} file(s) (${total} so far)`);
} }
return JobStatus.Success; return JobStatus.Success;
} }
@OnJob({ name: JobName.IntegrityOrphanedFiles, queue: QueueName.IntegrityCheck }) @OnJob({ name: JobName.IntegrityUntrackedFiles, queue: QueueName.IntegrityCheck })
async handleOrphanedFiles({ type, paths }: IIntegrityOrphanedFilesJob): Promise<JobStatus> { async handleUntrackedFiles({ type, paths }: IIntegrityUntrackedFilesJob): Promise<JobStatus> {
this.logger.log(`Processing batch of ${paths.length} files to check if they are orphaned.`); this.logger.log(`Processing batch of ${paths.length} files to check if they are untracked.`);
const orphanedFiles = new Set<string>(paths); const untrackedFiles = new Set<string>(paths);
if (type === 'asset') { if (type === 'asset') {
const assets = await this.integrityRepository.getAssetPathsByPaths(paths); const assets = await this.integrityRepository.getAssetPathsByPaths(paths);
for (const { originalPath, encodedVideoPath } of assets) { for (const { originalPath, encodedVideoPath } of assets) {
orphanedFiles.delete(originalPath); untrackedFiles.delete(originalPath);
if (encodedVideoPath) { if (encodedVideoPath) {
orphanedFiles.delete(encodedVideoPath); untrackedFiles.delete(encodedVideoPath);
} }
} }
} else { } else {
const assets = await this.integrityRepository.getAssetFilePathsByPaths(paths); const assets = await this.integrityRepository.getAssetFilePathsByPaths(paths);
for (const { path } of assets) { for (const { path } of assets) {
orphanedFiles.delete(path); untrackedFiles.delete(path);
} }
} }
if (orphanedFiles.size > 0) { if (untrackedFiles.size > 0) {
await this.integrityRepository.create( await this.integrityRepository.create(
[...orphanedFiles].map((path) => ({ [...untrackedFiles].map((path) => ({
type: IntegrityReportType.OrphanFile, type: IntegrityReportType.UntrackedFile,
path, path,
})), })),
); );
} }
this.logger.log(`Processed ${paths.length} and found ${orphanedFiles.size} orphaned file(s).`); this.logger.log(`Processed ${paths.length} and found ${untrackedFiles.size} untracked file(s).`);
return JobStatus.Success; return JobStatus.Success;
} }
@OnJob({ name: JobName.IntegrityOrphanedFilesRefresh, queue: QueueName.IntegrityCheck }) @OnJob({ name: JobName.IntegrityUntrackedFilesRefresh, queue: QueueName.IntegrityCheck })
async handleOrphanedRefresh({ items }: IIntegrityPathWithReportJob): Promise<JobStatus> { async handleUntrackedRefresh({ items }: IIntegrityPathWithReportJob): Promise<JobStatus> {
this.logger.log(`Processing batch of ${items.length} reports to check if they are out of date.`); this.logger.log(`Processing batch of ${items.length} reports to check if they are out of date.`);
const results = await Promise.all( const results = await Promise.all(
@@ -619,7 +619,7 @@ export class IntegrityService extends BaseService {
properties = ['assetId', 'fileAssetId'] as const; properties = ['assetId', 'fileAssetId'] as const;
break; break;
} }
case IntegrityReportType.OrphanFile: { case IntegrityReportType.UntrackedFile: {
properties = [void 0] as const; properties = [void 0] as const;
break; break;
} }

View File

@@ -38,8 +38,8 @@ const asJobItem = (dto: JobCreateDto): JobItem => {
return { name: JobName.IntegrityMissingFilesQueueAll }; return { name: JobName.IntegrityMissingFilesQueueAll };
} }
case ManualJobName.IntegrityOrphanFiles: { case ManualJobName.IntegrityUntrackedFiles: {
return { name: JobName.IntegrityOrphanedFilesQueueAll }; return { name: JobName.IntegrityUntrackedFilesQueueAll };
} }
case ManualJobName.IntegrityChecksumFiles: { case ManualJobName.IntegrityChecksumFiles: {
@@ -50,8 +50,8 @@ const asJobItem = (dto: JobCreateDto): JobItem => {
return { name: JobName.IntegrityMissingFilesQueueAll, data: { refreshOnly: true } }; return { name: JobName.IntegrityMissingFilesQueueAll, data: { refreshOnly: true } };
} }
case ManualJobName.IntegrityOrphanFilesRefresh: { case ManualJobName.IntegrityUntrackedFilesRefresh: {
return { name: JobName.IntegrityOrphanedFilesQueueAll, data: { refreshOnly: true } }; return { name: JobName.IntegrityUntrackedFilesQueueAll, data: { refreshOnly: true } };
} }
case ManualJobName.IntegrityChecksumFilesRefresh: { case ManualJobName.IntegrityChecksumFilesRefresh: {
@@ -62,8 +62,8 @@ const asJobItem = (dto: JobCreateDto): JobItem => {
return { name: JobName.IntegrityDeleteReportType, data: { type: IntegrityReportType.MissingFile } }; return { name: JobName.IntegrityDeleteReportType, data: { type: IntegrityReportType.MissingFile } };
} }
case ManualJobName.IntegrityOrphanFilesDeleteAll: { case ManualJobName.IntegrityUntrackedFilesDeleteAll: {
return { name: JobName.IntegrityDeleteReportType, data: { type: IntegrityReportType.OrphanFile } }; return { name: JobName.IntegrityDeleteReportType, data: { type: IntegrityReportType.UntrackedFile } };
} }
case ManualJobName.IntegrityChecksumFilesDeleteAll: { case ManualJobName.IntegrityChecksumFilesDeleteAll: {

View File

@@ -74,7 +74,7 @@ const updatedConfig = Object.freeze<SystemConfig>({
tonemap: ToneMapping.Hable, tonemap: ToneMapping.Hable,
}, },
integrityChecks: { integrityChecks: {
orphanedFiles: { untrackedFiles: {
enabled: true, enabled: true,
cronExpression: '0 03 * * *', cronExpression: '0 03 * * *',
}, },

View File

@@ -294,7 +294,7 @@ export interface IIntegrityDeleteReportsJob {
}[]; }[];
} }
export interface IIntegrityOrphanedFilesJob { export interface IIntegrityUntrackedFilesJob {
type: 'asset' | 'asset_file'; type: 'asset' | 'asset_file';
paths: string[]; paths: string[];
} }
@@ -428,9 +428,9 @@ export type JobItem =
| { name: JobName.WorkflowRun; data: IWorkflowJob } | { name: JobName.WorkflowRun; data: IWorkflowJob }
// Integrity // Integrity
| { name: JobName.IntegrityOrphanedFilesQueueAll; data?: IIntegrityJob } | { name: JobName.IntegrityUntrackedFilesQueueAll; data?: IIntegrityJob }
| { name: JobName.IntegrityOrphanedFiles; data: IIntegrityOrphanedFilesJob } | { name: JobName.IntegrityUntrackedFiles; data: IIntegrityUntrackedFilesJob }
| { name: JobName.IntegrityOrphanedFilesRefresh; data: IIntegrityPathWithReportJob } | { name: JobName.IntegrityUntrackedFilesRefresh; data: IIntegrityPathWithReportJob }
| { name: JobName.IntegrityMissingFilesQueueAll; data?: IIntegrityJob } | { name: JobName.IntegrityMissingFilesQueueAll; data?: IIntegrityJob }
| { name: JobName.IntegrityMissingFiles; data: IIntegrityPathWithReportJob } | { name: JobName.IntegrityMissingFiles; data: IIntegrityPathWithReportJob }
| { name: JobName.IntegrityMissingFilesRefresh; data: IIntegrityPathWithReportJob } | { name: JobName.IntegrityMissingFilesRefresh; data: IIntegrityPathWithReportJob }

View File

@@ -21,8 +21,8 @@
value: ManualJobName.IntegrityMissingFiles, value: ManualJobName.IntegrityMissingFiles,
}, },
{ {
title: $t('admin.maintenance_integrity_orphan_file_job'), title: $t('admin.maintenance_integrity_untracked_file_job'),
value: ManualJobName.IntegrityOrphanFiles, value: ManualJobName.IntegrityUntrackedFiles,
}, },
{ {
title: $t('admin.maintenance_integrity_checksum_mismatch_job'), title: $t('admin.maintenance_integrity_checksum_mismatch_job'),
@@ -33,8 +33,8 @@
value: ManualJobName.IntegrityMissingFilesRefresh, value: ManualJobName.IntegrityMissingFilesRefresh,
}, },
{ {
title: $t('admin.maintenance_integrity_orphan_file_refresh_job'), title: $t('admin.maintenance_integrity_untracked_file_refresh_job'),
value: ManualJobName.IntegrityOrphanFilesRefresh, value: ManualJobName.IntegrityUntrackedFilesRefresh,
}, },
{ {
title: $t('admin.maintenance_integrity_checksum_mismatch_refresh_job'), title: $t('admin.maintenance_integrity_checksum_mismatch_refresh_job'),

View File

@@ -30,7 +30,7 @@
let integrityReport: IntegrityReportSummaryResponseDto = $state(data.integrityReport); let integrityReport: IntegrityReportSummaryResponseDto = $state(data.integrityReport);
const TYPES: IntegrityReportType[] = [ const TYPES: IntegrityReportType[] = [
IntegrityReportType.OrphanFile, IntegrityReportType.UntrackedFile,
IntegrityReportType.MissingFile, IntegrityReportType.MissingFile,
IntegrityReportType.ChecksumMismatch, IntegrityReportType.ChecksumMismatch,
]; ];
@@ -53,8 +53,8 @@
async function runJob(reportType: IntegrityReportType, refreshOnly?: boolean) { async function runJob(reportType: IntegrityReportType, refreshOnly?: boolean) {
let name: ManualJobName; let name: ManualJobName;
switch (reportType) { switch (reportType) {
case IntegrityReportType.OrphanFile: { case IntegrityReportType.UntrackedFile: {
name = refreshOnly ? ManualJobName.IntegrityOrphanFilesRefresh : ManualJobName.IntegrityOrphanFiles; name = refreshOnly ? ManualJobName.IntegrityUntrackedFilesRefresh : ManualJobName.IntegrityUntrackedFiles;
break; break;
} }
case IntegrityReportType.MissingFile: { case IntegrityReportType.MissingFile: {

View File

@@ -57,8 +57,8 @@
if (confirm) { if (confirm) {
let name: ManualJobName; let name: ManualJobName;
switch (data.type) { switch (data.type) {
case IntegrityReportType.OrphanFile: { case IntegrityReportType.UntrackedFile: {
name = ManualJobName.IntegrityOrphanFilesDeleteAll; name = ManualJobName.IntegrityUntrackedFilesDeleteAll;
break; break;
} }
case IntegrityReportType.MissingFile: { case IntegrityReportType.MissingFile: {
@@ -108,7 +108,7 @@
const handleOpen = async (event: Event, props: Partial<ContextMenuBaseProps>, reportId: string) => { const handleOpen = async (event: Event, props: Partial<ContextMenuBaseProps>, reportId: string) => {
const items: MenuItems = []; const items: MenuItems = [];
if (data.type === IntegrityReportType.OrphanFile || data.type === IntegrityReportType.ChecksumMismatch) { if (data.type === IntegrityReportType.UntrackedFile || data.type === IntegrityReportType.ChecksumMismatch) {
items.push({ items.push({
title: $t('download'), title: $t('download'),
icon: mdiDownload, icon: mdiDownload,