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

Provide method which builds the OPDS URL #480

Closed
kelson42 opened this issue Apr 3, 2021 · 11 comments · Fixed by #527
Closed

Provide method which builds the OPDS URL #480

kelson42 opened this issue Apr 3, 2021 · 11 comments · Fixed by #527

Comments

@kelson42
Copy link
Collaborator

kelson42 commented Apr 3, 2021

Currently the process is:
1 - client builds the OPDS URL
2 - client makes the OPDS URL call and retrieve the OPDS feed
3 - client shares the OPDS feed with libkiwix which parse it and in returns gives the list of books as object

I want that the first steps is done by the libkiwix as this is a common step to all clients. A first version of that code should be already available in Kiwix Desktop (and therefore should be migrated to libkiwix and replaced by a call to new libkiwix method).

The JNI should be updated as Kiwix Android needs it really soon.

@kelson42
Copy link
Collaborator Author

kelson42 commented Apr 3, 2021

@mgautierfr Please let us know quickly if this does not make sense
@veloman-yunkan This is important to provide this soon as Kiwix Android next GSoC student will need it
@gouri-panda You will benefit of this. In the meantime you need to build the OPDS URL yourself for your first tests. See https://wiki.kiwix.org/wiki/OPDS

@veloman-yunkan
Copy link
Collaborator

@kelson42 I can't make sense of this ticket probably because I am missing some background.

I want that the first steps is done by the libkiwix as this is a common step to all clients

Can you please provide at least two examples in different clients?

@kelson42
Copy link
Collaborator Author

kelson42 commented Apr 18, 2021

@veloman-yunkan Where is built the https://library.kiwix.org/catalog/search OPDS URL with all the filter arguments?

@veloman-yunkan
Copy link
Collaborator

@kelson42
Copy link
Collaborator Author

kelson42 commented Apr 18, 2021

@veloman-yunkan This is what I meant with this ticket, each port should not do its own code to build the URL. Libkiwix shoukd provide a primitive taking the filters and returning the URL string.

@mgautierfr
Copy link
Member

mgautierfr commented Apr 19, 2021

The idea here is to use kiwix-lib to fully encapsulate the opds catalog.
For now we have :

  • Opds parsing/generation (generating a opds stream from a Library and the opposite).
  • Handling of api' url on the server side (we can parse query and answer them).

What is missing is a handling of the urls on the client side. This need will become even more needed with all the changes on the (opds) api (#209, https://github.com/kiwix/kiwix-tools/issues/317, #421, ...)

This (cpp) API is not so easy to design.
For example, on kiwix-desktop we do OPDS query only to get a subset of the catalog (filtered by lang and category) but other filtering (search based on name, ...) is made locally (as it is a subset of what we get with the previous opds query).
But on kiwix-ios I think they do a OPDS query all the time. On android I don't know.
The API must allow the user to decide what filtering is made on locally and what is made with opds.
And the main catalog is on "http://library.kiwix.org/catalog/" but this may not be the case (every kiwix-serve can serve a catalog, so the address of the catalog must be configurable).

Maybe, we can extend kiwix::Manager, or create another object kiwix::OpdsManager or introduce a kiwix::RemoteLibrary...
I havn't fully think about this, I'm open to idea.

@kelson42
Copy link
Collaborator Author

kelson42 commented Apr 26, 2021

The idea here is to use kiwix-lib to fully encapsulate the opds catalog.
For now we have :
* Opds parsing/generation (generating a opds stream from a Library and the opposite).
* Handling of api' url on the server side (we can parse query and answer them).

What is missing is a handling of the urls on the client side. This need will become even more needed with all the changes on the (opds) api (#209, kiwix/kiwix-tools#317, #421, ...)

Exactly

This (cpp) API is not so easy to design.
For example, on kiwix-desktop we do OPDS query only to get a subset of the catalog (filtered by lang and category) but other filtering (search based on name, ...) is made locally (as it is a subset of what we get with the previous opds query).
But on kiwix-ios I think they do a OPDS query all the time. On android I don't know.
The API must allow the user to decide what filtering is made on locally and what is made with opds.
And the main catalog is on "http://library.kiwix.org/catalog/" but this may not be the case (every kiwix-serve can serve a catalog, so the address of the catalog must be configurable).

Maybe, we can extend kiwix::Manager, or create another object kiwix::OpdsManager or introduce a kiwix::RemoteLibrary...
I havn't fully think about this, I'm open to idea.

This is an interesting discussion and indeed a complex topic. But IMO we should open a new ticket. This ticket is only about generating the URL string, this is neither complex nor subject to a discussion IMO.

@mgautierfr
Copy link
Member

This ticket is only about generating the URL string, this is neither complex nor subject to a discussion IMO.

For now, the opds url is only root.xml or a search query.
I think we can have a function taking a Filter has argument. Then the filter could be use either locally on a existing library or to generate a url (to get a opds that can be parse to create a local library).

If we decide to change that when we design the whole system, it would be not difficult to do.

@kelson42
Copy link
Collaborator Author

kelson42 commented May 2, 2021

@mgautierfr This ticket has been written with the search query in mind and agree with your last proposition. This is true that we might need an additional trivial method/api to get the root.xml URL if we want to be coherent.

@kelson42 kelson42 added this to the 10.0.0 milestone May 13, 2021
@kelson42
Copy link
Collaborator Author

@veloman-yunkan Are things clear now for implementation?

@veloman-yunkan
Copy link
Collaborator

@kelson42 I think so. I will submit a PR soon, and we'll see if I understood everything correctly.

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

Successfully merging a pull request may close this issue.

3 participants