View Single Post
Old 06-19-2012, 12:08 PM   #9
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,466
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
I pushed code to save db preferences when the GUI exits and to restore them when the db is restored. Preferences are saved to the file metadata_db_prefs.json in the same directory as metadata.db.

Preferences are not saved by command line tools. I don't think any of them modify preferences, so this shouldn't be a problem. Ahh ... perhaps saved searches can be created and deleted by command line tools. These changes will be lost if the gui hasn't run between the command line invocation and the restore.

There is another possible hole. If we have the sequence a) the preferences file came from db version N, b) calibre has been updated to db version N+1 and only a command line tool has run, and c) the upgrade function modifies preferences, then the restored preferences may be incorrect. Up to now, all db preference modifications have been done outside the db upgrade functions, so this isn't currently an issue.
chaley is offline   Reply With Quote