View Single Post
Old 05-21-2011, 06:44 PM   #1
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,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Custom columns and metadata sources

I've kind of touched on this subject a couple of times without a potential solution as yet. Kovid has said he will consider a patch but there are a few issues which would need to be resolved that I would appreciate ideas and suggestions on.

The challenge is to find a way to pass values for custom columns from a metadata source plugin through the new 0.8 metadata api. Why? Because it would allow metadata sources to scrape additional data – like the number of pages in the paperback edition, price, number of users who rated the book, etc. Basically any piece of data a particular website could offer in its detail page would become a potential candidate for a custom column.

There are three challenges to this problem I see:
  1. Allowing the user to configure for a metadata source what additional fields they would like scraped into what columns. On the surface just a plugin configuration screen issue which at its simplest would just allow specifying a custom column name for a metadata source field. There would be limitations – metadata sources are not per library configurable so you would have to use the same column in all your databases for instance.
  2. Changing all Kovid’s merge and persistence stuff in identify.py so that values in a custom column would survive the merge process. Including I guess “merging” values in terms of handling two plugins both returning a page count (just pick one), or two plugins returning differing custom columns. Not a showstopper I think.
  3. The most challenging possibly is setting the custom column value on the result Metadata object in the metadata source plugin. The problem being there is no db object. So how can I get the column definition to be able to set a custom column value on the object?

Any thoughts appreciated.
kiwidude is offline   Reply With Quote