MCPcopy
hub / github.com/immich-app/immich / syncAssetsV2

Method syncAssetsV2

server/src/services/sync.service.ts:277–289  ·  view source on GitHub ↗
(options: SyncQueryOptions, response: Writable, checkpointMap: CheckpointMap)

Source from the content-addressed store, hash-verified

275 }
276
277 private async syncAssetsV2(options: SyncQueryOptions, response: Writable, checkpointMap: CheckpointMap) {
278 const deleteType = SyncEntityType.AssetDeleteV1;
279 const deletes = this.syncRepository.asset.getDeletes({ ...options, ack: checkpointMap[deleteType] });
280 for await (const { id, ...data } of deletes) {
281 send(response, { type: deleteType, ids: [id], data });
282 }
283
284 const upsertType = SyncEntityType.AssetV2;
285 const upserts = this.syncRepository.asset.getUpserts({ ...options, ack: checkpointMap[upsertType] });
286 for await (const { updateId, ...data } of upserts) {
287 send(response, { type: upsertType, ids: [updateId], data: mapSyncAssetV2(data) });
288 }
289 }
290
291 private syncPartnerAssetsV1(): Promise<void> {
292 throw new BadRequestException(

Callers 1

streamMethod · 0.95

Calls 4

sendFunction · 0.85
mapSyncAssetV2Function · 0.85
getDeletesMethod · 0.45
getUpsertsMethod · 0.45

Tested by

no test coverage detected