r2-streamer-js
r2-streamer-js copied to clipboard
[DAISY-AVH] Content-type broken on reading-orders links
> URL=`curl -H "Authorization: Bearer $BEARER" -s https://eole-recette.avh.asso.fr/api/v1/search | jq -r '.publications[0].links[0].href'`
> curl -H "Authorization: Bearer $BEARER" -s $URL | jq '.readingOrder[0]'
{
"type": "audio/?",
"duration": 12.896,
"href": "Y061664/aud001.mp3?r2tkn=eyJoYXNoIjoiNTRkYWY5MjhhNTZlYzY4OWY5OWI5NmQ0MWRhZDY0MTdiYTBkNjdlNzdmZWE2OWI4NmVmODNlZTBiYTZmNDQ5MiIsInRpbWVzdGFtcCI6MTY2MDc0MDg2MTM3MywiZXhwaXJ5Ijo4NjQwMH0%3D"
}
what is the file extension of the audio resource?
code reference https://github.com/readium/r2-streamer-js/blob/41a8241cb05dc8fd2c385b09506a39c081005c9c/src/http/server-assets.ts#L193-L216
As you can see, the media type specified in the web pub manifest or EPUB package OPF tales precedence. However, the problem could be in the Daisy converter ... let me check.
here is the source of the problem:
https://github.com/readium/r2-shared-js/blob/7cdaef6803f9e8557c095c2f4418517072793bfe/src/parser/daisy-convert-to-epub.ts#L1167-L1171
good thing: both libs use the 'mime-types' NPM package. we need to check handling of upper/lower case, and it would be good to know what file extension the original audio resource has.
thanks Daniel 👍