mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-03 19:17:11 -05:00 
			
		
		
		
	feat(server): track metadata extracted at (#6352)
This commit is contained in:
		
							parent
							
								
									19e9908ee2
								
							
						
					
					
						commit
						f4edb6c4bd
					
				@ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user