feat: refresh missing & checksum

This commit is contained in:
izzy
2025-11-28 17:44:37 +00:00
parent e447ba87c6
commit 4d7f7b80da
5 changed files with 185 additions and 13 deletions
@@ -321,7 +321,14 @@ export class AssetJobRepository {
@GenerateSql({ params: [DummyValue.STRING], stream: true })
streamIntegrityReports(type: IntegrityReportType) {
return this.db.selectFrom('integrity_report').select(['id as reportId', 'path']).where('type', '=', type).stream();
return this.db
.selectFrom('integrity_report')
.select(['integrity_report.id as reportId', 'integrity_report.path'])
.where('integrity_report.type', '=', type)
.$if(type === IntegrityReportType.ChecksumFail, (eb) =>
eb.leftJoin('asset', 'integrity_report.path', 'asset.originalPath').select('asset.checksum'),
)
.stream();
}
@GenerateSql({ params: [], stream: true })