View Single Post
Old 10-22-2020, 03:54 PM   #11
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Is that part of the reason why an icon based on a composite template doesn't always immediately update when a column is modified by a plugin instead of the user?

For example: A #lastread date column, which is used for a composite text psuedobool #currentlyreading. (It also checks the #read bool for a 'false' value.)

Column icons are set to display an icon if #currentlyreading returns a "true."

If the user manually edits the #lastread date, the icon appears immediately.

If the Job Spy plugin autopopulates the #lastread, the icon doesn't appear until the list is resorted (though occasionally it won't show up until a new search is done, not sure why).
Its complicated.

First, simply updating a field using db.set_field doesn't clear the composite column cache. As far as I can tell, one must call db.clear_caches() to do that.

In addition, if data is changed then the GUI must be told so it can clear the various caches (rule, icon, emblem, covers, etc) , using get_gui().library_view.model().refresh_ids().

Sorting in the GUI *should* refresh the GUI cache. It doesn't refresh the DB search/composite cache so you can still get "old" results.

Searching in the GUI will (as far as I can see) refresh the GUI cache. The AFAICS comes from the fact that the GUI search has the option of not refreshing and I don't know where that option is used. It doesn't refresh the DB caches.

Does doing a bulk metadata edit, changing nothing, then pressing OK cause the icons to show correctly?

I would guess that switching between list and cover view would also clear caches.
chaley is offline   Reply With Quote