Skip to content

client API methods metadata

hannsolo edited this page May 6, 2020 · 2 revisions

getMetaData(path: string, options: IMetaDataOptions = {}): Promise<IMetaData>

Get the metadata of a single file or folder.

setMetaData(path: string, data: IMetaData, service: string = "file", options: IMetaDataOptions = {}): Promise<boolean>

Set one or more metadata field values for a single file or directory. "service" may be either "file" or "directory".

const metaData = {
  "iptc":{
    "Caption":"foo",
    "Headline":"bar"
  },
  "exif":{
    "Copyright holder":"foo"  
  }
};

client.setMetaData("images/image.tif", metaData)
.then( (success) => {
  console.log("done setting meta data with result " + success);
})
.catch(console.error);

deleteMetaData(path: string, data: IMetaData, service: string = "file", options: IMetaDataOptions = {}): Promise<boolean>

Delete one or more metadata field values for a single file or directory. "service" may be either "file" or "directory". The values of metadata will be ignored, only the keys are relevant to indicate which fields should be deleted.

restoreMetaData(path: string, data: IMetaData, service: string = "file", options: IMetaDataOptions = {}): Promise<boolean>

Restore one or more metadata field values for a single file or directory from its source. "service" may be either "file" or "directory". The values of metadata will be ignored, only the keys are relevant to indicate which fields should be restored.

Clone this wiki locally