Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 11-21-2011, 11:22 AM   #1
xmodder
Junior Member
xmodder began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Nov 2011
Device: Samsung Galaxy Tab
Custom columns and epub metadata

Hi to all

I know that installing in Calibre the plugin Modify Epub, and checking the checkbox "Update Metadata (including cover)", you can update your ebooks in epub format with the metadata you have put on Calibre for that ebook. This not only updates standard metadata fields (as author, title and so on) on the file content.opf inside the epub, but also creates custom metadata fields on content.opf in the form:
Code:
<meta content="{&quot;is_category&quot;: true, &quot;is_editable&quot;: true, &quot;kind&quot;: &quot;field&quot;, &quot;is_custom&quot;: true, &quot;name&quot;: &quot;Hugo&quot;, &quot;#extra#&quot;: null, &quot;datatype&quot;: &quot;series&quot;, &quot;colnum&quot;: 3, &quot;rec_index&quot;: 22, &quot;search_terms&quot;: [&quot;#hugo&quot;], &quot;link_column&quot;: &quot;value&quot;, &quot;label&quot;: &quot;hugo&quot;, &quot;is_multiple&quot;: null, &quot;column&quot;: &quot;value&quot;, &quot;#value#&quot;: null, &quot;category_sort&quot;: &quot;value&quot;, &quot;table&quot;: &quot;custom_column_3&quot;, &quot;is_multiple2&quot;: {}, &quot;display&quot;: {}}" name="calibre:user_metadata:#hugo" />
Well, that was a simple custom column to indicate if a book has won an Hugo prize.

My question is if it is possible to do the reverse. I mean: Is it possible to recover this data from an epub to Calibre? Not thinking on creating automatically custom columns for that, (doing that would be a dream, but I understand that thecnically it seems hard to do) but, if I have a Calibre library that includes the same custom colums that correspond to that custom metadata fields in the content.opf file, is there a way to make Calibre to retrieve the values in the custom fields metadata into the corresponding custom columns? Simply matching by name, for example. And only for editable custom columns, calculated custom columns can be recreated on Calibre, but those data stored on custom columns would be lost if the book is exported.

As of now, I can't do that on Calibre... I have a book that includes the previous described custom metadata on the file content.opf, I have created a custom column with the same name on the calibre library, but neither when I add the book to the libray or update metada from the epub, that custom column is not populated with the content of the custom metadata in content.opf.

So, any idea on how to accomplish this?
xmodder is offline   Reply With Quote
Old 11-21-2011, 09:35 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The only time that calibre reads custom column metadata from OPF files is during a restore library operation, during which it will even re-create missing custom columns.
kovidgoyal is offline   Reply With Quote
Advert
Old 11-22-2011, 08:57 AM   #3
capnm
Groupie
capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'
 
Posts: 156
Karma: 10001
Join Date: Feb 2011
Device: sony
Restoring some books from a backup (don't ask), here's what I did:

Created a new, empty library.
Copied the book folders into the library folder, being careful to produce a valid library folder structure.
(Re)built the library with the restore database function.
Copied the books into the desired library with the copy to library function.
capnm is offline   Reply With Quote
Old 11-22-2011, 10:51 AM   #4
xmodder
Junior Member
xmodder began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Nov 2011
Device: Samsung Galaxy Tab
Quote:
Originally Posted by kovidgoyal View Post
The only time that calibre reads custom column metadata from OPF files is during a restore library operation, during which it will even re-create missing custom columns.
Ok... I think I have finally understood that you are referring to the metadata.opf files present on each directory in a calibre libray. I was not referring to that OPF files, but to the content.opf file that each epub includes as part of the structure of the .epub file.

The metadadata.opf files created by calibre for each book in the library only contains metadata defined for the corresponding calibre library.
As you know, each .epub file contains a "content.opf" file inside, that holds metadata and the files manifest for the epub. That metadata contained in the internal content.opf file is the one I am interested in.

Calibre reads that metadata from internal epub content.opf file when adding books to a libray (if you have configured that in preferences , what is the default) but only reads standard metadata, not custom ones. Also calibre recovers stadard metadata from content.opf in .epub when you click the button "Import metadata from selected format", but again, only standard metadata, not custom ones.

So, my question is if there is some way to tell calibre to read not only standard metadata from that internal content.opf file but also custom metadata. Again, from the .epub internal content.opf file, not from the external, calibre created, metadata.opf.

Best regards
xmodder is offline   Reply With Quote
Old 11-22-2011, 10:54 AM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,782
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by xmodder View Post
Ok... I think I have finally understood that you are referring to the metadata.opf files present on each directory in a calibre libray. I was not referring to that OPF files, but to the content.opf file that each epub includes as part of the structure of the .epub file.

The metadadata.opf files created by calibre for each book in the library only contains metadata defined for the corresponding calibre library.
As you know, each .epub file contains a "content.opf" file inside, that holds metadata and the files manifest for the epub. That metadata contained in the internal content.opf file is the one I am interested in.

Calibre reads that metadata from internal epub content.opf file when adding books to a libray (if you have configured that in preferences , what is the default) but only reads standard metadata, not custom ones. Also calibre recovers stadard metadata from content.opf in .epub when you click the button "Import metadata from selected format", but again, only standard metadata, not custom ones.

So, my question is if there is some way to tell calibre to read not only standard metadata from that internal content.opf file but also custom metadata. Again, from the .epub internal content.opf file, not from the external, calibre created, metadata.opf.

Best regards
Your EPUB may fail validation with 'non-standard fields error'
theducks is online now   Reply With Quote
Advert
Old 11-22-2011, 11:21 AM   #6
xmodder
Junior Member
xmodder began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Nov 2011
Device: Samsung Galaxy Tab
Quote:
Originally Posted by theducks View Post
Your EPUB may fail validation with 'non-standard fields error'
I don't see why this should give any validation problem, custom metadata fields on epubs are contemplated on the epub specifications.

And, by the way, Fligthcrew doesn't complain about it. Just tested some epubs with custom metadata and check is OK.
xmodder is offline   Reply With Quote
Old 11-22-2011, 11:37 AM   #7
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,782
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
You may be right about Flightcrew. I Know you can't SET a custom field using the Metadata editor of Sigil
theducks is online now   Reply With Quote
Old 11-22-2011, 09:31 PM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, there is no way to tell calibre to read custom column metadata from inside a book file.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
importing metadata into custom columns taleia Library Management 4 10-03-2023 05:56 AM
Custom columns and metadata sources kiwidude Development 30 06-05-2014 01:36 AM
Custom Columns - How are you using yours? nynaevelan Library Management 19 04-18-2011 12:42 AM
New Metadata class (empty books) and custom columns kiwidude Development 14 03-12-2011 06:47 AM
0.7.46 and custom columns meme Library Management 4 02-21-2011 04:21 AM


All times are GMT -4. The time now is 05:48 PM.


MobileRead.com is a privately owned, operated and funded community.