mirror of
https://github.com/immich-app/immich.git
synced 2025-01-06 03:46:47 +01:00
feat(server): track metadata extracted at (#6352)
This commit is contained in:
parent
19e9908ee2
commit
f4edb6c4bd
4 changed files with 30 additions and 2 deletions
|
@ -252,6 +252,11 @@ export class MetadataService {
|
||||||
fileCreatedAt: exifData.dateTimeOriginal ?? undefined,
|
fileCreatedAt: exifData.dateTimeOriginal ?? undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await this.assetRepository.upsertJobStatus({
|
||||||
|
assetId: asset.id,
|
||||||
|
metadataExtractedAt: new Date(),
|
||||||
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,4 +12,7 @@ export class AssetJobStatusEntity {
|
||||||
|
|
||||||
@Column({ type: 'timestamptz', nullable: true })
|
@Column({ type: 'timestamptz', nullable: true })
|
||||||
facesRecognizedAt!: Date | null;
|
facesRecognizedAt!: Date | null;
|
||||||
|
|
||||||
|
@Column({ type: 'timestamptz', nullable: true })
|
||||||
|
metadataExtractedAt!: Date | null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||||
|
|
||||||
|
export class AddMetadataExtractedAt1705094221536 implements MigrationInterface {
|
||||||
|
name = 'AddMetadataExtractedAt1705094221536';
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE "asset_job_status" ADD "metadataExtractedAt" TIMESTAMP WITH TIME ZONE`);
|
||||||
|
await queryRunner.query(`
|
||||||
|
UPDATE "asset_job_status"
|
||||||
|
SET "metadataExtractedAt" = NOW()
|
||||||
|
FROM "exif"
|
||||||
|
WHERE "exif"."assetId" = "asset_job_status"."assetId";
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE "asset_job_status" DROP COLUMN "metadataExtractedAt"`);
|
||||||
|
}
|
||||||
|
}
|
|
@ -474,11 +474,12 @@ export class AssetRepository implements IAssetRepository {
|
||||||
case WithoutProperty.EXIF:
|
case WithoutProperty.EXIF:
|
||||||
relations = {
|
relations = {
|
||||||
exifInfo: true,
|
exifInfo: true,
|
||||||
|
jobStatus: true,
|
||||||
};
|
};
|
||||||
where = {
|
where = {
|
||||||
isVisible: true,
|
isVisible: true,
|
||||||
exifInfo: {
|
jobStatus: {
|
||||||
assetId: IsNull(),
|
metadataExtractedAt: IsNull(),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue