View Single Post
Old 09-13-2021, 04:56 AM   #689
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,460
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by capink View Post
Quote:
Originally Posted by chaley View Post
I suggest you open a bug report suggesting that
Code:
set_metadata(id_, get_metadata(_id))
shouldn't signal any dirty books and see what he says.
I tried this and it does not make a difference, the set_metadata() still calls set_field() for every field, which in turn will dispatch a db event. I think I may have misunderstood you here.
This tests whether setting a book's metadata to itself generates any events with a non-empty set of books. In particular it tests whether set_field() thinks the book was dirtied when in theory it shouldn't have been.

Quote:
Originally Posted by capink View Post
Quote:
Originally Posted by chaley View Post
With the changes I have made you get changed events for the set_field() operations, but with an empty book set. I don't know if it is worth trying to filter those out at the
I don't think it is worth filtering out. At least in my case, they will be discarded.
TUrns out that the it is easy to filter the events in set_field() with no performance penalty.

EDIT: I think that in a couple of hours I will have code you can test.
chaley is offline   Reply With Quote