View Single Post
Old 09-12-2016, 09:04 AM   #7
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,984
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by kovidgoyal View Post
@JimmXinu: set_custom and set_metadata dont operate on the db so there is no question of notifying the GUI
??? They don't change the schema, but they certainly change values in the db. And I apparently misread the code--set_metadata does send the GUI the refresh message.

It looks to me more like set_custom should also send the refresh IPC message to the GUI. The change is quite small, I can make a PR if you like.

Code:
diff --git a/src/calibre/library/cli.py b/src/calibre/library/cli.py
index 759c775..a996806 100644
--- a/src/calibre/library/cli.py
+++ b/src/calibre/library/cli.py
@@ -1065,6 +1065,8 @@ def command_set_custom(args, dbpath):
         return 1
     do_set_custom(get_db(dbpath, opts), args[0], int(args[1]), args[2],
             opts.append)
+    write_dirtied(db)
+    send_message()
     return 0
Not that the change will make it perfect--the same sort of race conditions that require GUI PIs to use proceed_question will still be possible.
JimmXinu is offline   Reply With Quote