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

Correct Read links in Search Inside results when multiple files or filename-vs.-id disparity #1254

Open
RayBB opened this issue Oct 7, 2023 · 0 comments

Comments

@RayBB
Copy link

RayBB commented Oct 7, 2023

Copying issue from internetarchive/openlibrary#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:

default: 'Sorry, there was an error with your search. Please try again.',

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

1 participant