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

Method syncAlbumsV1

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

Source from the content-addressed store, hash-verified

427 }
428
429 private async syncAlbumsV1(options: SyncQueryOptions, response: Writable, checkpointMap: CheckpointMap) {
430 const deleteType = SyncEntityType.AlbumDeleteV1;
431 const deletes = this.syncRepository.album.getDeletes({ ...options, ack: checkpointMap[deleteType] });
432 for await (const { id, ...data } of deletes) {
433 send(response, { type: deleteType, ids: [id], data });
434 }
435
436 const upsertType = SyncEntityType.AlbumV1;
437 const upserts = this.syncRepository.album.getUpserts({ ...options, ack: checkpointMap[upsertType] });
438 for await (const { updateId, ...data } of upserts) {
439 const albumUsers = await this.syncRepository.album.getAlbumUsers(data.id);
440 send(response, { type: upsertType, ids: [updateId], data: syncAlbumV2ToV1(data, albumUsers) });
441 }
442 }
443
444 private async syncAlbumsV2(options: SyncQueryOptions, response: Writable, checkpointMap: CheckpointMap) {
445 const deleteType = SyncEntityType.AlbumDeleteV1;

Callers 1

streamMethod · 0.95

Calls 5

syncAlbumV2ToV1Function · 0.90
sendFunction · 0.85
getAlbumUsersMethod · 0.80
getDeletesMethod · 0.45
getUpsertsMethod · 0.45

Tested by

no test coverage detected