Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
panaC opened this issue Aug 18, 2022 · 6 comments
Open

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

panaC opened this issue Aug 18, 2022 · 6 comments

Comments

@panaC
Copy link
Member

panaC commented Aug 18, 2022


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

@danielweck
Copy link
Member

what is the file extension of the audio resource?

@danielweck
Copy link
Member

code reference

let mediaType = mime.lookup(pathInZip);
if (link && link.TypeLink) {
mediaType = link.TypeLink;
}
const isText = (typeof mediaType === "string") && (
mediaType.indexOf("text/") === 0 ||
mediaType.indexOf("application/xhtml") === 0 ||
mediaType.indexOf("application/xml") === 0 ||
mediaType.indexOf("application/json") === 0 ||
mediaType.indexOf("application/svg") === 0 ||
mediaType.indexOf("application/smil") === 0 ||
mediaType.indexOf("+json") > 0 ||
mediaType.indexOf("+smil") > 0 ||
mediaType.indexOf("+svg") > 0 ||
mediaType.indexOf("+xhtml") > 0 ||
mediaType.indexOf("+xml") > 0);
// const isVideoAudio = mediaType && (
// mediaType.indexOf("audio/") === 0 ||
// mediaType.indexOf("video/") === 0);
// if (isVideoAudio) {
// debug(req.headers);
// }

@danielweck
Copy link
Member

danielweck commented Aug 18, 2022

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
Copy link
Member

@danielweck
Copy link
Member

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.

@panaC
Copy link
Member Author

panaC commented Aug 18, 2022

thanks Daniel 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants