View Single Post
Old 05-10-2015, 11:59 PM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,789
Karma: 30237628
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by eschwartz View Post
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 - yes, I sort of knew that, but better to let the horse speak for itself.

My method is likewise bespoke, enscapulated in saved rename & saved S&R, I don't need it often enough to make it better'n that.

BR
BetterRed is offline   Reply With Quote