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

Feature request: How to add custom metadata provider? #161

Open
dodog opened this issue Dec 20, 2024 · 12 comments
Open

Feature request: How to add custom metadata provider? #161

dodog opened this issue Dec 20, 2024 · 12 comments

Comments

@dodog
Copy link

dodog commented Dec 20, 2024

This book library looks very good. It would like to add my whole library, but I found out it that the default import search does not find the books I own (mostly Slovak and Czech). Would it be possible to add search for ISBN or title in Czech National library database?

https://aleph.nkp.cz/F/?func=file&file_name=find-b&local_base=NKC&CON_LNG=ENG

@bayang
Copy link
Owner

bayang commented Dec 20, 2024

Which default import did you use ? Have you activated inventaire in the settings ? If not maybe you could give it a try.

@dodog
Copy link
Author

dodog commented Dec 20, 2024

First I just used the automatic default import. Then I created the application.yml and enabled google and inventaire plugins. But it could not find the randomly selected Slovak and Czech books. I tried to search directly in inventaire.io and no search results. English books are found instantly.

How can I add custom metadata provider?

@dodog dodog changed the title Feature request: Search for ISBN or title in Czech National library database? Feature request: How to add custom metadata provider? Jan 13, 2025
@bayang
Copy link
Owner

bayang commented Jan 14, 2025

short answer is you can't.

Long answer is : the only way is to develop a new metadata provider for each source.

@dodog
Copy link
Author

dodog commented Jan 14, 2025

Thank you for your answer. Is it difficult to develop a new metadata provider? Could you please direct me how to create a new provider?

@bayang
Copy link
Owner

bayang commented Jan 15, 2025

By the way have you tried to activate only the google api provider or to put it first in the priorities ? It is quite powerful as google has a massive database. I think it could work quite well.

Concerning the development it is not complicated if, and only if, you have an API to query.
You can have a look at the google API provider, it was developed by a third party dev.
First all providers have to implement a common interface :
https://github.com/bayang/jelu/blob/main/src/main/kotlin/io/github/bayang/jelu/service/metadata/providers/IMetaDataProvider.kt

Which means your code receives an isbn, and/or a title and/or an authors list, it should query your target API and then return the most relevant result.

The google implementtion is here :
https://github.com/bayang/jelu/blob/main/src/main/kotlin/io/github/bayang/jelu/service/metadata/providers/GoogleBooksIMetaDataProvider.kt

@dodog
Copy link
Author

dodog commented Jan 15, 2025

I tried, but could not find anything - it is just loading and loading, but no result. Same for calibre.
screenshot-2025-01-15_12-24-42
When I try inventaire.io, I get this screen, but when I click to "Import", nothing is filled out.
screenshot-2025-01-15_12-24-15
Maybe some error messages would be useful like "book not found" or something else.

When I tried to search for this particular book in google books, it is found, so maybe there is something wrong with my setup.

This is my application.yml

@bayang
Copy link
Owner

bayang commented Jan 15, 2025

I just remembered the google API provider only fetches by isbn.
With isbn your book is found but I also discovered a few bugs while testing.
I'll try to add support for search by title or authors with the google plugin.

But as soon as I'll release a fix for the bug you'll be able to search again by isbn at least for now.

Your config is fine by the way. Providers are called by decreasing order of priority, ie provider with highest priority is called first.

@dodog
Copy link
Author

dodog commented Jan 15, 2025

ok, but when I use ISBN only in Jelu via Google API, the book is not found. If I go manually to books.google.com and I enter the ISBN, the book is found. So, maybe there is some other issue.

@bayang
Copy link
Owner

bayang commented Jan 15, 2025

I just found a bug with some results in the google provider. The example book you pasted above triggers this bug.
I'll release a fix and then you can try again.

@dodog
Copy link
Author

dodog commented Jan 15, 2025

oh, ok. Thank you.

bayang added a commit that referenced this issue Jan 17, 2025
github-actions bot pushed a commit that referenced this issue Jan 17, 2025
## [0.65.0](v0.64.0...v0.65.0) (2025-01-17)

### Features

* orphan authors and series management [#148](#148) ([9061b88](9061b88))

### Bug Fixes

* google api provider [#161](#161) ([ba3cb81](ba3cb81))
* less disturbing taginput css [#179](#179) ([f64990d](f64990d))
@bayang
Copy link
Owner

bayang commented Jan 17, 2025

The google provider should be fixed now. You can try again with isbn, title or author search.
The results should be better suited to your researches.

@dodog
Copy link
Author

dodog commented Jan 18, 2025

I tried the google provider with ISBN: 9788088912767, but it does not seems to work. In Jelu, the book is not found. In books.google.com using the same ISBN 9788088912767 - the book is found.

I checked the logs, but it shows some errors only for the previous search of book (ISBN 9788073910594), maybe it is not related to this jelu.log. Can you please have a look?

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

2 participants