View Single Post
Old 04-23-2019, 01:41 AM   #7
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
Experimentally, populating the .opf file inside an .epub doesn't cause Calibre to read the metadata contained in that file, regardless of whether it's created as a generic tag using
Code:
<meta name="foo" content="bar"/>
or using the tag construction Calibre does in the metadata.opf attached to an epub file:
Code:
<meta name="calibre:user_metadata:#test" content="{&quot;display&quot;: {&quot;description&quot;: &quot;&quot;, &quot;is_names&quot;: true}, &quot;colnum&quot;: 1, &quot;column&quot;: &quot;value&quot;, &quot;#extra#&quot;: null, &quot;table&quot;: &quot;custom_column_1&quot;, &quot;is_category&quot;: true, &quot;rec_index&quot;: 22, &quot;is_csp&quot;: false, &quot;#value#&quot;: [&quot;foo, bar&quot;], &quot;category_sort&quot;: &quot;value&quot;, &quot;is_multiple&quot;: &quot;|&quot;, &quot;is_multiple2&quot;: {&quot;cache_to_list&quot;: &quot;|&quot;, &quot;ui_to_list&quot;: &quot;&amp;&quot;, &quot;list_to_ui&quot;: &quot; &amp; &quot;}, &quot;datatype&quot;: &quot;text&quot;, &quot;name&quot;: &quot;Test&quot;, &quot;is_editable&quot;: true, &quot;kind&quot;: &quot;field&quot;, &quot;label&quot;: &quot;test&quot;, &quot;search_terms&quot;: [&quot;#test&quot;], &quot;link_column&quot;: &quot;value&quot;, &quot;is_custom&quot;: true}"/>
For ebooks I'm more or less generating myself, I can create the dc:subject tags when I build the rest of it. For AO3, since dc:subject tags are already there, I probably have to copy the existing epub and rewrite the content.opf file. Because I'm going to want to store the results of tag processing locally (because it requires calling out to the Internet), there's really no way around keeping two epubs. The only other thing I could do is use calibredb to do the insertion in the Calibre database (which I think does allow me to set custom fields) and then have a separate file that caches the results of tag processing.
I just tested exporting EPUB with "Update metadata in saved copies" enabled then imported those EPUB files to an empty library with matching custom columns. All custom columns seem to have been populated just fine. The #test custom column does exist in your library, right, and you just copied that formatting from a Calibre-generated OPF?

Note, I think the comma may be a hard coded special character for tag-like custom columns (even if it's set to contain names) so avoid using it in the value.

Assuming "foo, bar" is meant to be a single tag in custom column #test, just try removing the comma.

Assuming "foo, bar" is supposed to be two separate tags in custom column #test, that should be "foo", "bar".
ilovejedd is offline   Reply With Quote