-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Define some endpoints for metadata (and other) #631
Comments
Interesting! #616 was about restoring access to an information we used to get. Gentle reminder, whenever you expose something, people will start relying on it. Behind #616 is a dead-simple access to metadata of a book/zim. I suppose we could return what's in the catalog and users would be happy. Proposed illustration endpoint looks good to me 👍 On the
|
Yes. And this is why I discuss this here before creating/updating the endpoint.
What kind of check ? The fact that
Maybe we can serve the endpoint only with a
You're right. warc2zim already rely to much on HTTP-server, we should not make things worth and make it using a absolute url.
I'm not sure to understand if it is a good thing or not. |
Can't say. I know @kelson42 is used to that URL for reading the Counter as a quick zim check alternative. I want to make sure he understands that you are proposing to remove that easy way so it doesn't come as a surprise.
Good question for which I have no answer. It's more of a product one than a technical one. What should be considered though is that our UI has issues and if we allow this raw access, it will come as a relief for integrators and will surely lead them into investing time into building different chromes. Ones they do, we'll have difficulties getting them back to ours if we want to and we'll be pressured into back porting their features (which can be positive but resources consuming). I'm in favor of having it but it should be though through and done via a clear, maintained endpoint and not just some debug one that everybody end up relying on. As you suggested earlier ; a step by step approach is probably for the best. |
Finaly giving a feedback on this. That said I'm still not sure to fully understand everything so please pardon me if I do silly remarks:
|
They are answering to two different questions :
Yes,
We agree. Except if we want to introduce some kind of compatibility or content management. We cannot use
In this case, we are adding a compatibility layer. |
@mgautierfr Thanks, I still don't understand all the details but trust you. Not problem with keeping the |
Following my comment here #626 (comment) I would like to open a discussion on what we need to serve and how.
I think there is two different use case :
It seems that we already a way to get information about book with recent implementation of partial entries (#602), we can get all the metadata of a book by simply asking it to the catalog.
What is missing is a entry point to download the illustration (from what we have in the library/catalog).
I propose the entrypoint
/catalog/v2/illustration/<bookId>?size=<size>
The size parameter setting the width and height. Assuming a scale=1. If (when) we extend the illustration to non scare illustration and different scale we will add the corresponding parameter.
Illustration would be taken from what is in the catalog (in library.xml if kiwix-serve is started with one), never from the zim file.
So the
/meta
endpoint is ok to read the zim file as it would correspond to the second use case.But I we recreate it, I would like to take the occasion to go a bit further.
As the "meta" endpoint will return the metadata unchanged, we can also extend it to also return raw content/item in the whole zim file.
Something like:
/raw/<zimName>/meta/<metaName>
to get the metadata in the zim file. If present. Unchanged. No fallback./raw/<zimName>/content/<contentPath>
to get the content of a entry in the zim files. If present. Unchanged (no chrome, no header bar added, no url rewritten). No fallback (at least not more than what libzim is making internally to handle compatibility)The
/raw/<zimName>/content/
endpoint may help with warc2zim where the ServiceWorker need to access the raw content as it is adding its own chrome. (openzim/warc2zim#16 #403)What do you think about this ?
We don't have to implement everything in the same time. But
/catalog/v2/illustration
and/raw/<zimName>/meta/
(if we agree on them) are needed shortly.The text was updated successfully, but these errors were encountered: