r2-streamer-js icon indicating copy to clipboard operation
r2-streamer-js copied to clipboard

[DAISY-AVH] Content-type broken on reading-orders links

Open panaC opened this issue 3 years ago • 6 comments
trafficstars


> 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"
}

panaC avatar Aug 18 '22 10:08 panaC

what is the file extension of the audio resource?

danielweck avatar Aug 18 '22 11:08 danielweck

code reference https://github.com/readium/r2-streamer-js/blob/41a8241cb05dc8fd2c385b09506a39c081005c9c/src/http/server-assets.ts#L193-L216

danielweck avatar Aug 18 '22 11:08 danielweck

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.

danielweck avatar Aug 18 '22 11:08 danielweck

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

danielweck avatar Aug 18 '22 11:08 danielweck

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.

danielweck avatar Aug 18 '22 11:08 danielweck

thanks Daniel 👍

panaC avatar Aug 18 '22 11:08 panaC