0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-07 00:50:23 -05:00

Fixed Websocket not getting correct data on mobile

This commit is contained in:
Alex 2022-08-15 23:43:12 -05:00 committed by GitHub
parent e2169a26c2
commit 9642ad2820
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,6 +19,7 @@ import {
thumbnailGeneratorQueueName,
JpegGeneratorProcessor,
} from '@app/job';
import { mapAsset } from 'apps/immich/src/api-v1/asset/response-dto/asset-response.dto';
@Processor(thumbnailGeneratorQueueName)
export class ThumbnailGeneratorProcessor {
@ -29,7 +30,7 @@ export class ThumbnailGeneratorProcessor {
@InjectQueue(thumbnailGeneratorQueueName)
private thumbnailGeneratorQueue: Queue,
private wsCommunicateionGateway: CommunicationGateway,
private wsCommunicationGateway: CommunicationGateway,
@InjectQueue(metadataExtractionQueueName)
private metadataExtractionQueue: Queue,
@ -68,7 +69,9 @@ export class ThumbnailGeneratorProcessor {
);
await this.metadataExtractionQueue.add(imageTaggingProcessorName, { asset }, { jobId: randomUUID() });
await this.metadataExtractionQueue.add(objectDetectionProcessorName, { asset }, { jobId: randomUUID() });
this.wsCommunicateionGateway.server.to(asset.userId).emit('on_upload_success', JSON.stringify(asset));
this.wsCommunicationGateway.server
.to(asset.userId)
.emit('on_upload_success', JSON.stringify(mapAsset(asset)));
}
});
}
@ -99,7 +102,9 @@ export class ThumbnailGeneratorProcessor {
await this.metadataExtractionQueue.add(imageTaggingProcessorName, { asset }, { jobId: randomUUID() });
await this.metadataExtractionQueue.add(objectDetectionProcessorName, { asset }, { jobId: randomUUID() });
this.wsCommunicateionGateway.server.to(asset.userId).emit('on_upload_success', JSON.stringify(asset));
this.wsCommunicationGateway.server
.to(asset.userId)
.emit('on_upload_success', JSON.stringify(mapAsset(asset)));
})
.run();
}