View Single Post
Old 05-10-2015, 07:33 PM   #4
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
BR -- it is very custom, unfortunately.

It relies on bash, so it won't work on Windows, and uses hardcoded assumptions about what a filename must look like. I'd like to fix that, but I don't know how to deal with named capturing groups purely in bash+universal utilities.

It shouldn't be too hard though, to simply chain together calibredb add $file ==> $added_book_id ==> calibredb set_metadata -f "field1:contents1" $added_bookid
The trick is to extract the right information from the path, and especially what to do if some of it is optional.
eschwartz is offline   Reply With Quote