Quote:
Originally Posted by kovidgoyal
last_modified is for internal calibre use, its how calibre keeps track of whichbackup opf files need to be re-done. And editing column definitions definitely requiresthem to be re done. last_Modified, explicitly *does not* mean the last time the user edited the books metadata.
|
I know we are not going to agree on this, but...
Unfortunately, most people
do interpret last_Modified as when the metadata was last changed. They use it to decide things like if a book needs to be sent to their device or if they need to do some sort of work on the book.
But, I don't. I interpret it as when the last time something about that book changed. But, I completely disagree that changing the column definition is changing the book. Some changes yes, but, if I change the display format of a number to include a percent sign, I don't consider that is a change to the data, just how it will be shown in some place. Changing last_modified just seems wrong for this.
The same goes for changing a template or the list of values for a "Text, but with a fixed set of permitted values" (if I removed a value being used, that is different case). Adding or removing a column is a little different, but, I still would tend to not change the last_modified.
If the issue is to trigger the backup of the OPF files, then using "mark_as_dirty" with a parameter to not call "update_last_modified" should do it. The only thing missing is clearing some caches, but, as you need to reboot calibre after these changes, that will happen then. Of course, triggering that isn't hard to do.
And for the record, I had not realised that using "Queue all books for backup" would update last_modified. I suppose that demonstrates it is not a useful value for users and probably should not be displayed. And searching the code, I can't see anywhere that it is actually used. It gets set, but, I can't see anything that actually does something with it. From your comment, I was expecting to find tests using it.