View Single Post
Old 12-10-2009, 07:38 PM   #1
macr0t0r
Connoisseur
macr0t0r doesn't littermacr0t0r doesn't litter
 
macr0t0r's Avatar
 
Posts: 91
Karma: 108
Join Date: Jan 2008
Device: Palm Treo 680, Sony Reader
Question 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?

- Jim
macr0t0r is offline   Reply With Quote