Hang on. I have another way.
This almost certainly invalidates my warranty.
Adding a new title has lots of baggage (copying files, creating/copying cover images, and so on) that I don't want to duplicate. Fair enough, calibredb can take care of that for me.
Setting metadata, on the other hand, is just updating a record (if it's built-in, like publisher) or adding a record (custom column). I don't
need calibredb to do that. I can handle that externally.
I know that each script works with only one database at a time. I can do
- calibredb add
- set_metadata via script
- set_custom (multiple) via script
safely enough. Even if the next calibredb loads the entire database and saves the entire database after making changes, the scripted updates/inserts happen before that starts. No chance of having both active concurrently, so no chance of one overwriting the other.
If calibre-server means that each calibredb call is handled (more or less) atomically I might still be able to have two load processes running against the same library (brokered by the server) safely... but I don't count on that. Which is okay, I can have processes loading against different libraries and that's enough for now.