Open da1nerd opened 7 years ago
On the other hand. It's very convenient to have the format available if the RC is indeed composed of a single format. We could make this field optional so we have the best of both worlds. If the field is empty we'll just assume this RC may contained mixed formats.
What if we turn format
into an array instead?
That could potentially be fine, though there's another thing to consider. In the api we are using the format like so:
"formats": [
{
"format": "application/zip; content=text/usfm",
"modified": "2016-10-03",
"size": 2171200,
"url": "https://cdn.door43.org/en/ulb/v7/en-ulb-usfm.zip",
"signature": "https://cdn.door43.org/en/ulb/v7/en-ulb-usfm.zip.sig"
},
{
"format": "application/zip; type=audio content=audio/mp3 conformsto=rc0.2",
"modified": "2016-10-03",
"size": 2171200,
"url": "https://cdn.door43.org/en/ulb/v7/en-ulb-rc-audio.zip",
"signature": "https://cdn.door43.org/en/ulb/v7/en-ulb-rc-audio.zip.sig"
}
]
e.g. application/zip; content=text/usfm
. Allowing multiple formats to an RC makes this field problematic.
Some Day
Rather than restricting an RC to a single format we can allow mixed content and simply rely on file extensions to determine how to use the contained files. This will allow us to do things like combining tA images with the text for a single download and allow referencing the images with relative links which will work both offline and online.