Closed hadro closed 10 months ago
The fix here is pretty simple, we need to make another use of the existing coerce_list() function to handle complexity in description fields.
Specifically,
Line 304: item.summary = {"none": [metadata["description"]]} should be: item.summary = {"none": [coerce_list(metadata["description"])]}
and similarly Line 108: child.summary = {"none": [item['description']]} should be: child.summary = {"none": [coerce_list(item["description"])]}
@digitaldogsbody CCing you again here, if you're making changes soon feel free to incorporate but if not I can do a PR in the coming days
For documentation purposes - I actually went with a slightly different fix here: Since summary
is a language map (https://iiif.io/api/presentation/3.0/#summary), it can have an array of values, and the issue was that we were double-wrapping it so it became "summary": {"none": [["value 1", "value 2"]]}
.
I've fixed it by adding a conditional that only wraps the value in a list if it isn't already, otherwise it passes it through as-is.
Flagged by @barmintor on the IIIF community call:
At a quick glance, looks like it's failing because metadata['description'] is an array: https://archive.org/metadata/annualreport00carn_14