readium / mobile

📱 Readium Mobile is a toolkit for ebooks, audiobooks and comics written in Swift & Kotlin.
https://readium.org/mobile
BSD 3-Clause "New" or "Revised" License
97 stars 4 forks source link

Checking the audiobook conformance of a RWPM + getting the durations #26

Open mickael-menu opened 2 years ago

mickael-menu commented 2 years ago

According to the Readium Audiobook Profile, a RWPM must contain the duration property in the Link objects to conform.

However, the mobile toolkits Publication.conformsTo() API is only checking the media type in the reading order, not the availability of duration, so it's not checking full conformance. The reason for this is that we don't have the info for Zipped Audiobooks.

As a workaround, we could add an Audio/MediaPublicationService which will compute the duration from:

Then, the conformsTo() API could use this info to check that the duration is available for all the resources of the reading order.

qnga commented 2 years ago

In hindsight, I feel like the conformsTo method might have been a mistake. To really check conformance to a profile, we have Publication.metadata.conformsTo. The method (vs the property) has been designed to determine which navigator should be used to render the publication. I don't think that's the responsibility of the shared module. Each navigator should be able to claim which publication it supports, whatever profile it conforms to, if any.

mickael-menu commented 2 years ago

Each navigator should be able to claim which publication it supports, whatever profile it conforms to, if any.

I like this idea, testing a queue of navigator implementations until one handles the publication. In which case, that's fine if we're stricter with the conformsTo() API.

qnga commented 2 years ago

Makes sense to me.