Skip to content
Snippets Groups Projects
Commit 48e7eb5c authored by Mathias Maaß's avatar Mathias Maaß
Browse files

Fix metadata selector

parent 5edb867b
No related branches found
No related tags found
No related merge requests found
......@@ -150,19 +150,18 @@ export function getCanvasLabel(canvas, canvasIndex) {
}
/**
* Return canvas metadata in a label / value structure
* Return metadata in a label / value structure
* This is a potential seam for pulling the i18n locale from
* state and plucking out the appropriate language.
* For now we're just getting the first.
* @param {object} IIIF Resource
* @param {object} Manifesto IIIF Resource (e.g. canvas, manifest)
* @return {Array[Object]}
*/
export function getDestructuredMetadata(iiifResoruce) {
return (iiifResoruce
&& iiifResoruce.getMetadata()
&& iiifResoruce.getMetadata().map(resource => ({
label: resource.label[0].value,
value: resource.value[0].value,
&& iiifResoruce.getMetadata().map(labelValuePair => ({
label: labelValuePair.getLabel(),
value: labelValuePair.getValue(),
}))
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment