nao-pon/flysystem-google-drive

getMetadata() does not return complete information

Closed this issue · 2 comments

Bilge commented

Comparing the information available for files fetched from listContents() and getMetadata() shows alarming inconsistencies which can be difficult to work around. Specifically, getMetadata() is inferior because of the following behaviours:

  • dirname property is missing
  • basename property is missing
  • path does not show a slash (/)-separated folder hierarchy; instead just shows a last parent node id.

listContents() and getMetadata() should return the same data in the same, consistent format.

@Bilge The dirname and basename properties are not included in the return value of the listContents() function of the GoogleDrive adapter. It is attached by FlySystem after that.

The value of path is calculated from the value passed to getMetadata(). Please include the hierarchical structure in the passed value.

Bilge commented

Thanks @nao-pon, I was able to resolve my issue by passing around path instead of basename identifiers.