Defining Metadata with "calibredb add" command line function.
Okay, I'm back with more command-line stuff. It's high time I dump my entire library in Calibre.
However, some files have done a poor job of labeling metadata. Sometimes it's by directory name, and sometimes it's in the file itself (yah, it's a mess...that's why I'm putting it in Calibre). My problem is that the "calibredb add" function doesn't appear to support defining metadata (--author "John Smith" --Title "Horribly Formatted Book"). There is the "set_metadata" function, but that requires the Database ID, and the calibredb add function does not return that value. I can't be sure how successful the import was, so I can't really automate what title to search for with the "list" command in order to get the database ID.
I want to add a book, get the database id, and then use the id to set metadata and cover page. What is the best way to get the database id of the last added book?