fenimore/badreads

Entering book manually if book not found with ISBN saved

Closed this issue · 5 comments

Hello,
Thank you very much for this app.

When you scan a barcode, it finds the ISBN.
If the book is not known by Open Library, nothing happens.
It would be good to be suggested to add the book manually, keeping in mind this ISBN (so no need to re-type it).

Thanks!

Hi! Thank you for identifying this, I'll see what I can do 🤔

Hey @fenimore , I did a little research into this:

  • Adding a book to OpenLibrary requires a registered user on OpenLibrary. If you're not signed in to OpenLibrary, trying to access the 'Add a book' function will just redirect you to the login page. Thus, in order for this feature request to make any practical sense at all, you'd probably have to implement signing in to OpenLibrary in the Badreads app itself. Unfortunately, the OpenLibrary API neither supports creating books nor signing in users via API, so you might have to get creative...
  • If you can ensure that the user is signed into OpenLibrary in the app, then it's a question of redirecting the user to https://openlibrary.org/books/add and finding some way of pre-filling the HTML input tag that has id="id_name" name="id_name" with either "isbn_10" or "isbn_13" depending on the barcode scanned, as well as pre-filling the input tag that has id="id_value" name="id_value" with the actual ISBN. As for the pre-filling itself, I've done some preliminary googling, but can't seem to get a straight answer on whether it is possible. In theory, it should be doable, if nothing else then by editing the DOM, but I'm very far from an expert in that.

Hey! This is a really good idea @StoppingBuck , I see what you mean 🤔

I would probably at first maybe add a button that would add a new Book into Badreads with that isbn, and prompt for a title

Hey @Sonegide The new release https://github.com/fenimore/badreads/releases/tag/v0.0.7 v0.0.7 should be available on Fdroid soon. This will add a button, so when you scan the ISBN, if no results appear you can add a book title manually with the ISBN prefilled. I hope this helps! Reopen the ticket if you think it doesn't fit as expected ☺️

Thanks a lot!