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

Incorrect interpretation of the OPDS 2 indirect acquisition feature. #2208

Open
llemeurfr opened this issue May 15, 2024 · 0 comments
Open
Assignees
Labels

Comments

@llemeurfr
Copy link
Contributor

The way Thorium is programmed, the behavior of acquisition links is constrained by the content type of the link target: in

const acquisitionLinkView = this.convertFilterLinksToView(baseUrl, r2OpdsPublication.Links, {
we see that a link of type acquisition or acquisition/open-access is active only if the content type is one of those listed in
const supportedFileTypeLinkArray = [

HTML is not one of them.

This constraint does not exist for links of type acquisition/buy or acquisition/subscribe.
And the label of the button is associated with the acquisition type (acquisition/buy => "Buy this book").

Now here is the issue: A bookseller provides a subscription based service. He wants to provide an ODPS catalog to his users, but he cannot provide OPDS Authentication at this time.
The solution I proposed is to generate an OPDS catalog with links to individual pages of his Web site, where users can authenticate, download an LCP license and side-load the license into Thorium Reader.

The feed should be like

"publications": [
    {
      "metadata": {
        "@type": "http://schema.org/Book",
        "title": "xxxx",
        "author": "xxxx",
        "identifier": "urn:isbn:xxxx",
        "language": "en"
      },
      "links": [
        {
          "rel": "http://opds-spec.org/acquisition",
          "href": "//link to the web page corresponding to the book//",
          "type": "text/html"
        }
      ],
      "images": [
        {
          "href": "https://edrlab.org/public/feed/moby-dick/cover.jpg",
          "type": "image/jpeg",
          "height": 499,
          "width": 348
        }
      ]
    }
]

But the rel = acquisition does not give what is expected, the button does not appear.
I must use rel = acquisition/buy, but the label of the button is not what I expect.

I would like this use-case to be supported and every type of acquisition link be compatible with an html page as a target. The label could be "Import (Web)" if the acquisition link is of type acquisition.

I also see a bug with acquisition/borrow, whatever content type I use: I get a blank page and I must quit Thorium.
You can test with this test OPDS feed -> https://edrlab.org/public/feed/test/opds-feed.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants