View Single Post
Old 04-23-2019, 11:03 PM   #9
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,110
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
Quote:
Originally Posted by ceridwen View Post
You're right that if I save the file somewhere else and reimport it, it keeps the custom column data. I did some experimentation on this and it left me more confused than I was before. If I unzip the test epub that contains the custom column data and then copy select tags into the content.opf of another test from the content.opf of the known-to-work ebub and re-zip it, Calibre doesn't pick up the metadata in the custom column. Copying the entire content.opf doesn't work, either. Most confusingly, if I unzip the known-to-work epub, don't change anything, and then zip the same files into a new epub, that doesn't get the custom column metadata when I import it. I even checked the extra field of the original zipfile, which seems to be empty.

Does anyone know how this works?
EPUB has specific rules when you zip it. Iirc, the first file added to the ZIP must be the manifest and it must be stored without compression. Can't remember the rules exactly right now.

Alternately, if you want to avoid EPUB surgery, you can keep the modified OPF file alongside the EPUB using the same filename as the EPUB (or I think even metadata.opf if one title per folder). I've noticed Calibre always respected external OPF files during import if they exist.


Quote:
In this case, it's mean to be two separate tags. I entered those tags into the Calibre GUI manually to create the files I've been using for testing. Do you mean it has to be entered "foo", "bar" in the Calibre GUI?
Sorry wasn't more clear. I meant in the OPF.
Code:
"#value#": ["foo", "bar"]
At least that's how my tag-like custom columns were stored when I inspected the OPFs.
ilovejedd is offline   Reply With Quote