High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix(server): missing metadata extraction job (#2586)
Alexfc2455be808c
diff --git a/server/apps/immich/src/api-v1/asset/asset.core.ts b/server/apps/immich/src/api-v1/asset/asset.core.tsindex 9732d7e2ac..8b9d868034 100644--- a/server/apps/immich/src/api-v1/asset/asset.core.ts+++ b/server/apps/immich/src/api-v1/asset/asset.core.ts@@ -43,7 +43,7 @@ export class AssetCore {sidecarPath: sidecarFile?.originalPath || null,});- await this.jobRepository.queue({ name: JobName.GENERATE_JPEG_THUMBNAIL, data: { id: asset.id } });+ await this.jobRepository.queue({ name: JobName.METADATA_EXTRACTION, data: { id: asset.id, source: 'upload' } });if (asset.type === AssetType.VIDEO) {await this.jobRepository.queue({ name: JobName.VIDEO_CONVERSION, data: { id: asset.id } });}diff --git a/server/apps/immich/src/api-v1/asset/asset.service.spec.ts b/server/apps/immich/src/api-v1/asset/asset.service.spec.tsindex 39d107dcc3..a97592ead9 100644--- a/server/apps/immich/src/api-v1/asset/asset.service.spec.ts+++ b/server/apps/immich/src/api-v1/asset/asset.service.spec.ts@@ -328,9 +328,14 @@ describe('AssetService', () => {});expect(jobMock.queue.mock.calls).toEqual([- [{ name: JobName.GENERATE_JPEG_THUMBNAIL, data: { id: assetEntityStub.livePhotoMotionAsset.id } }],+ [+ {+ name: JobName.METADATA_EXTRACTION,+ data: { id: assetEntityStub.livePhotoMotionAsset.id, source: 'upload' },+ },+ ],[{ name: JobName.VIDEO_CONVERSION, data: { id: assetEntityStub.livePhotoMotionAsset.id } }],- [{ name: JobName.GENERATE_JPEG_THUMBNAIL, data: { id: assetEntityStub.livePhotoStillAsset.id } }],+ [{ name: JobName.METADATA_EXTRACTION, data: { id: assetEntityStub.livePhotoStillAsset.id, source: 'upload' } }],]);});});diff --git a/server/libs/domain/src/job/job.interface.ts b/server/libs/domain/src/job/job.interface.tsindex 3a0d2ecc82..bbc966eb9c 100644--- a/server/libs/domain/src/job/job.interface.ts+++ b/server/libs/domain/src/job/job.interface.ts@@ -19,6 +19,7 @@ export interface IFaceThumbnailJob extends IAssetFaceJob {export interface IEntityJob extends IBaseJob {id: string;+ source?: string;}export interface IBulkEntityJob extends IBaseJob {diff --git a/server/libs/domain/src/job/job.service.ts b/server/libs/domain/src/job/job.service.tsindex 379ce64592..26c044e7ad 100644--- a/server/libs/domain/src/job/job.service.ts+++ b/server/libs/domain/src/job/job.service.ts@@ -110,6 +110,12 @@ export class JobService {await this.jobRepository.queue({ name: JobName.STORAGE_TEMPLATE_MIGRATION_SINGLE, data: item.data });break;+ case JobName.STORAGE_TEMPLATE_MIGRATION_SINGLE:+ if (item.data.source === 'upload') {+ await this.jobRepository.queue({ name: JobName.GENERATE_JPEG_THUMBNAIL, data: item.data });+ }+ break;+case JobName.GENERATE_JPEG_THUMBNAIL: {await this.jobRepository.queue({ name: JobName.GENERATE_WEBP_THUMBNAIL, data: item.data });await this.jobRepository.queue({ name: JobName.CLASSIFY_IMAGE, data: item.data });diff --git a/server/package.json b/server/package.jsonindex aa36616161..1b9f0a263c 100644--- a/server/package.json+++ b/server/package.json@@ -141,7 +141,7 @@"./libs/domain/": {"branches": 80,"functions": 87,- "lines": 94,+ "lines": 93.8,"statements": 93}},