View Single Post
Old 09-13-2021, 08:40 AM   #690
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
Here are changes to make set_field() not signal dirty books if nothing actually changed. If they work for you then I will make a pull request to give them to Kovid. The changes in formatter_functions aren't part of the main changes, but instead make testing for being in the gui more robust.

My test function does set_metadata(get_metadata()) on evey book in the
Code:
target library. Run it with calibre-debug -e test.py path-to-library
Note that it really does update metadata so you should keep a backup if you want repeatable tests. For example, in one of my libraries setting the comments field did some cleanup so a change was signaled. On the second run no cleanup was needed and no change was signaled.

I also checked the changes using the calibre test suite.
Attached Files
File Type: zip py_files_for_test.zip (47.6 KB, 309 views)
chaley is offline   Reply With Quote