Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 11-02-2021, 01:13 PM   #1
soilheart
Junior Member
soilheart began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2021
Device: Kobo Glo HD (/Forma)
How to best write workaround for Google Books API Bug

Hi.

So, I came upon this Google Books API "bug" a few days ago:

https://stackoverflow.com/questions/...-giving-output

In my case the problematic ISBN was 9780786954377, e.g. https://books.google.com/books/feeds...:9780786954377 didn't return any results, while https://books.google.com/books/feeds...:9780786954377 returned the book as expected.

I thought I'd make a PR for this, but need help to figure out the best solution out of the following.

1. Fallback to ISBN:XXX if no result is found when searching for isbn:XXX
1.a. ... if no author or title is set (this way the fallback won't affect "normal operation").

2. Add support for checking "google" identifier and fetching data for the correct book without searching (seems like there's no way to search for the google identifier).
2. a. ... if no "isbn" identifier exist (this way you don't have to clear the google identifier if you change the isbn and want to search anew).

Any opinions/other suggestions?
soilheart is offline   Reply With Quote
Old 11-02-2021, 11:18 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,251
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can check if the topmost result has the specified isbn and if not try with the alternate form. As for adding support for "google" is ther some motivation for that?
kovidgoyal is offline   Reply With Quote
Advert
Old 11-03-2021, 02:34 AM   #3
soilheart
Junior Member
soilheart began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2021
Device: Kobo Glo HD (/Forma)
Quote:
Originally Posted by kovidgoyal View Post
You can check if the topmost result has the specified isbn and if not try with the alternate form.
Right, the only downside to this as I see it is that it will change the worst case API calls from 2 to 3, but I guess that's not too bad when I think about it. Will try to make a patch soon and make a PR on github.

Quote:
Originally Posted by kovidgoyal View Post
As for adding support for "google" is ther some motivation for that?
The two suggestions was intended as one or the other. As I see it, the second suggestion however would be more work and more of a generic "workaround", but it would also provide a more "robust" way to identify a specific publication of a book on Google Books.
soilheart is offline   Reply With Quote
Old 11-03-2021, 11:32 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,251
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I dont think bothering with the google identifier is worth it. As for the PR, it is most welcome.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Arc Google maps api v2 is not working in kobo arc Angel Shah Kobo Tablets 3 05-29-2013 11:27 AM
Synopsis display bug, and workaround. GeoffR Kobo Reader 1 04-08-2013 11:26 AM
Wrong-cover bug workaround? rwhe Kobo Reader 31 02-01-2013 05:33 PM
ePubs and Google Font API Justin Rotkowitz ePub 1 03-29-2011 11:33 AM
calibre now uses the Google Books API to get metadata kovidgoyal Calibre 9 03-23-2009 09:36 PM


All times are GMT -4. The time now is 09:09 AM.


MobileRead.com is a privately owned, operated and funded community.