()
| 207 | } |
| 208 | |
| 209 | private async getNodeInternal(): Promise<NodeEntity> { |
| 210 | if (this.type === PathType.MyFiles) { |
| 211 | const rootNode = await this.driveSdk.getMyFilesRootFolder(); |
| 212 | return this.getNodeByPath(rootNode, this.sectionPath); |
| 213 | } |
| 214 | if (this.type === PathType.SharedWithMe || this.type === PathType.PhotosSharedWithMe) { |
| 215 | const rootNode = await this.getSharedWithMeRootFolder(); |
| 216 | return this.getNodeByPath(rootNode, this.sectionPathWithoutRoot); |
| 217 | } |
| 218 | if (this.type === PathType.Trash || this.type === PathType.PhotosTrash) { |
| 219 | const parts = splitPathSegments(this.sectionPath); |
| 220 | if (parts.length > 1) { |
| 221 | throw new ValidationError('Browsing trashed folders is not supported'); |
| 222 | } |
| 223 | return this.getTrashedNode(parts[0]); |
| 224 | } |
| 225 | if (this.type === PathType.Devices) { |
| 226 | const rootNode = await this.getDevicesRootFolder(); |
| 227 | return this.getNodeByPath(rootNode, this.sectionPathWithoutRoot); |
| 228 | } |
| 229 | if (this.type === PathType.Photos) { |
| 230 | return this.getPhotoNodeByPath(this.sectionPath); |
| 231 | } |
| 232 | if (this.type === PathType.Albums) { |
| 233 | return this.getAlbumNodeByPath(this.sectionPath); |
| 234 | } |
| 235 | throw new ValidationError('Not implemented'); |
| 236 | } |
| 237 | |
| 238 | async getChild(name: string) { |
| 239 | const node = await this.getNode(); |
no test coverage detected