internetarchive / internetarchive/bookreader
Correct Read links in Search Inside results when multiple files or filename-vs.-id disparity
- Dominant language
- JavaScript
- Stars
- 1.2k
- Forks
- 491
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 3
Description
Copying issue from https://github.com/internetarchive/openlibrary/issues/339
> In the Search Inside search results, the Read links need to be changed to handle cases where the image stack filename is different from the Archive.org ID (as often happens due to characters like spaces in the filename), and where the search result is for one file in an Archive.org item containing multiple files.
>
> In both cases, the solution is to construct links that incorporate the filename, as opposed to only the Archive.org ID, when necessary. The filename can be parsed via the Metadata API.
>
> e.g.
> Metadata API call:
> https://archive.org/metadata/savefanfiction-10399417-It_was_worth_it-kettleowl/files
>
> Link to BookReader with Search Inside:
> https://archive.org/stream/savefanfiction-10399417-It_was_worth_it-kettleowl/It%20was%20worth%20it-ffnet_10399417#search/Friendship
>
> FYI: Incorrect link that redirects to Details page:
> http://archive.org/stream/savefanfiction-10399417-It_was_worth_it-kettleowl#search/Friendship
>
Indeed when you click that second link above you get an error:
`Sorry, there was an error with your search. Please try again.`
Which I think comes from here:
https://github.com/internetarchive/bookreader/blob/ecbac783e2325a1117228cdfe331121dcccaf6b3/src/BookNavigator/search/search-provider.js#L113
Contributor guide
Assessment
This issue has not been assessed yet.