View Single Post
Old 07-08-2012, 01:48 PM   #531
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,999
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by chaley View Post
I am going to jump in here after reading something on the generate cover thread. I have no idea what this plugin does, but as I wrote the custom column and template code in calibre, perhaps I can help.
Great, thanks!

Quote:
Originally Posted by chaley View Post
...
If the plugin is doing the above or something like it, then between steps 2 and 3 (I think) it should do "db.refresh_ids([list of book ids])", where "db" is the database object that you should already have. The list of IDs should contain all the ids that you will pass to get_metadata.
Basically, that is what's happening. And I arrived at the same solution after some experimentation:

Code:
self.gui.library_view.model().refresh_ids([book_id])
If that's the official solution, I can certainly live with it.

But it would have been a lot easier to find if the behavior were consistent, either one way or the other.

A simple custom column and a composite column with a simple template ("{#characters}, {#genre}"): both work without the refresh.

But a composite column with a template function ("{#genre:uppercase()}") doesn't work without the refresh.
JimmXinu is offline