Closed domkm closed 7 months ago
For sure, that would be helpful! Thank you.
This extension should be on Locator.Locations
though, you can take inspiration from this HTML extension: https://github.com/readium/swift-toolkit/blob/a62962bbb862a5852ce8f79c5369213f38c79e8e/Sources/Shared/Publication/Extensions/HTML/Locator+HTML.swift
As for the result, I'd prefer a struct
or at least tuple with named values.
What do you think of providing a method of extracting time(s) from a
Locator
There is a private extension on
Locator
which kind of does this, but looks like it only matches start time (my understanding is that end time can be specified).https://github.com/readium/swift-toolkit/blob/a62962bbb862a5852ce8f79c5369213f38c79e8e/Sources/Navigator/Audiobook/AudioNavigator.swift#L389-L409
Would you be open to a
Locator.time
property/function (() -> (Double?, Double?)?
). I'd be open to providing a PR for this if you want.