View Single Post
Old 06-11-2020, 01:36 AM   #1
Tazling
Member
Tazling began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Jun 2020
Device: iPad, Marvin
CLI: can I swap author and title in metadata?

I can do this the hard way, by embedding invocations of ebook-meta in a higher level scripting language like Tcl or whatever. But it would be nice if I could do it with the syntax for ebook-meta command.

I have a whole whack of epubs, obviously formatted by amateurs, in which the author name is in the title metadata field and vice versa. Maybe 60 or more. Really messes up my author-based library index in Marvin . I don't feel like fooling around with a GUI (Calibre) for hours to deal with this problem... by loading all the books and manually editing the fields (gosh, carpal tunnel here we come).

I checked the manpage and have to admit I don't see anything obviously encouraging... But given how incredibly common (and vexing!) this type of problem is, wouldn't it be nice if the command honoured a syntax like

ebook-meta -a -m title -t -m author

(set field Author (-a flag) to Metadata (-m) "Title" field value)

or even

ebook-meta -switch -a -t

I'm probably dreaming here and so am about to go off and write Yet Another Tedious Script to parse the output of ebook-meta, find the relevant fields, and then reissue the command to swap the values. Or maybe parse the filenames and then brute-force the metadata... But it really is quite un-fun, boring coding either way (yaaaawn), and it seems to me (from googling) that this problem is very common indeed, so wouldn't it be nice to be able to juggle the metadata directly using one invocation of ebook-meta, instead of having to extract and then re-set?
Tazling is offline   Reply With Quote