MCPcopy Create free account
hub / github.com/ProtonDriveApps/sdk / getPhotoByName

Method getPhotoByName

cli/src/cli/paths.ts:322–333  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

320 private async getAlbumChildByName(albumNode: NodeEntity, name: string): Promise<NodeEntity> {
321 const photoNodeUids = await Array.fromAsync(
322 this.photosSdk.iterateAlbum(albumNode.uid),
323 (item) => item.nodeUid,
324 );
325 for await (const maybeMissingNode of this.photosSdk.iterateNodes(photoNodeUids)) {
326 if ('missingUid' in maybeMissingNode) {
327 continue;
328 }
329 if (getName(maybeMissingNode) === name) {
330 return maybeMissingNode;
331 }
332 }
333 throw new ValidationError(`Photo not found: ${name}`);
334 }
335
336 private async getPhotoNodeByPath(pathString: string): Promise<NodeEntity> {

Callers 1

getPhotoNodeByPathMethod · 0.95

Calls 3

getNameFunction · 0.90
iterateNodesMethod · 0.65
iterateTimelineMethod · 0.45

Tested by

no test coverage detected