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

[develop] Locator href for exploded archive audiobook incorrectly starts with leading slash #429

Closed
domkm opened this issue May 19, 2024 · 2 comments · Fixed by #432
Closed
Labels
bug Something isn't working triage Triage needed by maintainers

Comments

@domkm
Copy link
Contributor

domkm commented May 19, 2024

Describe the bug

The documentation says Locator href format for files is changing: "/dir/my chapter.html becomes the relative URL path dir/my%20chapter.html". However, when I load an audiobook from a local directory URL where the files within the directory are MP3s using 3.0.0 alpha, I see locators that appear to be a combination of the old format and new format. Specifically, they are now percent encoded but the leading slash is still present.

How to reproduce?

  1. Open an audiobook publication using a FileURL for a directory that contains audio files.
  2. Create a navigator for said publication.
  3. Observe the format of locator hrefs created by the navigator.

Readium version

develop (3.0.0)

OS version

iOS 17.5

Testing device

Mac (built for iPad)

Environment

macOS: `sw_vers -productVersion`
platform: `uname -m`
carthage: `carthage version`
Xcode 15.4
Build version 15F31d

Additional context

No response

@domkm domkm added bug Something isn't working triage Triage needed by maintainers labels May 19, 2024
@domkm
Copy link
Contributor Author

domkm commented May 20, 2024

Also, what should hrefs look like for direct audio files (not zip/exploded archive)? For example, if I create a an audiobook from a local URL file:///path/to/publication/book-title.mp3, I assumed the hrefs would be "book-title.mp3" but instead I'm seeing "publication.mp3".

@mickael-menu
Copy link
Member

Thanks for spotting that @domkm, it was an oversight.

For example, if I create a an audiobook from a local URL file:///path/to/publication/book-title.mp3, I assumed the hrefs would be "book-title.mp3" but instead I'm seeing "publication.mp3".

Locators should not break if you rename the file or use it on another device. This is why they need to be stable.
In the case of ZIP archives it's easy, because the entry paths are always relative to the archive root. For standalone files we can't use the file name as the user might change it. I went with publication.<format extension> as this is what is used when packaging a file with the Readium LCP server (a PDF file is embedded in a ZIP archive at publication.pdf).

It is not super critical though, with standalone files there's no need to disambiguate between entries in a locator, so the href is not really needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Triage needed by maintainers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants