View Single Post
Old 10-26-2011, 03:11 PM   #151
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,733
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@Zetmolm - I don't know anything about the FB2 format. However unless there is some magical helper class in Calibre that exposes some HTML page content from it internally (like there is for MOBI), then the only way to get a page count would be from doing a conversion to EPUB. However this could be done internally by the plugin, so you don't actually "keep" the EPUB version in your library.

@Vaesse - good reminder. That one should be a little easier to do, I'll take a look.

@ElMiko - there's a few other points to think about. I think I have to support a fallback option (since short stories or books not on Goodreads etc will not otherwise get a page count). Which has two complications - firstly how to handle that from a UI/configuration perspective, and secondly whether people will want/care about the fact that some of their page counts will be paperbook based and others are ebook count based. They will not necessarily know (without peering at the log each time) which it is.

From a configuration perspective, I am going to drop the ePub/Mobi selection, and just use the "Preferred input format order". It was what I originally did with this plugin I think, and it is necessary if I am going to support counting from other formats.

I think rather than adding to the existing dropdown of page count algorithms, I will add a new one above it for "Retrieve from web" with options of "No website lookup", and "Goodreads" for now. I may add other websites like Amazon later, but Goodreads is one of the best for coverage, well for english books anyway!

So if a user picks "No website lookup", you get the behaviour you have today. If they choose "Goodreads" and no book match is found, then it will fallback to use the standard pagecount algorithm you have selected now.

From a wordcount perspective, nothing changes in that you cannot get that from a website. However I will consider adding some other formats - either directly like txt files, or indirectly by doing an internal conversion to ePub if there is no ePub format already like I mentioned for FB2 support above.

Finally people should bear in mind that getting from a website is not a guarantee that it will be any more "accurate" with the number they "had in mind". As I have said previously on this thread, there is no "one number" for a page count - large vs small print vs revised editions can result in quite a variance. The other risk is that the book it picks up is not the one you think - for instance if the plugin matches an omnibus edition. But it should get it close enough most of the time
kiwidude is offline   Reply With Quote