View Single Post
Old 05-20-2009, 06:55 AM   #3
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Bash scripting doesn't have the best support for xml parsing...

Depending on who the data is written to the file it could be either very difficult or very easy.

Say the data looks like this:

Code:
<book>
  <path>/home/you/books/author/title.ext</path>
  <title>Test Title</title>
  <author>Test Author</title>
</book>
<book>
  <path>/home/you/books/author/title2.ext</path>
  <title>Test Title</title>
  <author>Test Author</title>
</book>
All you would need to do is iterate over each book node, get the path, title, and author values, then create the command line arguments for ebook-meta and call it. If you use python you could actually the components directly from your script. If you go this route you can find everything you need in calibre.ebooks.metadata.cli.
user_none is offline   Reply With Quote