![]() |
#1 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Apr 2014
Location: Belgium
Device: Sony PRS-T1
|
EPUB metadata used by Calibre
Hello,
I have created an EPUB that is part of a series. I have put Code:
<meta content="Series Name" name="calibre:series" /> <meta content="1" name="calibre:series_index" /> When I add the book, calibre correctly parses this data and it appears in the metadata. I tried to do the same with the creation date and the publication date but it doesn't work. I googled for calibre metadata but everytime I get explanations on how to use the metadata editor which is not what I want. I want to create an EPUB that can be added to the calibre library including the correct metadata. I then downloaded the complete source code of calibre and found "calibre:series_index" in opf2.py. In that same file I found references to pubdate_path (which apparently uses a "date" tag) and timestamp. I used the date tag and the timestamp tag using the dc and calibre namespaces, but every time I add the book, calibre insists on putting today's date in Date, Published and Modified. Can someone please explain which metadata tags from the EPUB are processed by calibre and where I have to put them in the EPUB so that calibre can find them? Thanks -=Wim=- |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,347
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Just set some distinctive values for your desired metadata in calibre then save an epub to disk, open it up and see how calibre saves the metadata fields you are interested in.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Here is an example content.opf from a book in my library (see attachment). It appears to be using:
Code:
<meta name="calibre:timestamp" content="2013-01-20T05:45:35+00:00"/> Code:
<dc:date>2003-01-02T00:00:00+00:00</dc:date> |
![]() |
![]() |
![]() |
#4 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
I am pretty sure calibre will insist on putting the current datetime in as "Date" which represents the date added to calibre, unless you import the book SAVE, not just the book. Since that will usually include calibre's metadata.opf, it will set all metadata according to the metadata.opf, including the Added-to-calibre datetime.
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Apr 2014
Location: Belgium
Device: Sony PRS-T1
|
So I edited the metadata of a book (I put 2008-10-12 in the date field and 2010-12-14 in the published field), opened metadata.opf from the book folder and found these:
Code:
<dc:date>2010-12-13T23:00:00+00:00</dc:date> <meta content="2008-10-11T22:00:00+00:00" name="calibre:timestamp"/> Next, I put Code:
<meta content="2010-12-13T23:00:00+00:00" name="dc:date" /> <meta content="2008-10-11T22:00:00+00:00" name="calibre:timestamp" /> I remove the book from the calibre library, and add the modified one. In the metadata.opf file I find: Code:
<dc:date>2014-04-08T22:00:00+00:00</dc:date> <meta content="2014-04-09T09:39:48.364000+00:00" name="calibre:timestamp"/> Observations: 1) calibre does not interpret the content.opf file of the EPUB correctly. 2) calibre uses different rules for the timezone (I'm in UTC+2). If I enter 2008-10-12 in the DATE field in the UI, calibre subtracts 2 hours If I enter 2010-12-14 in the PUBLISHED field, calibre subtracts 1 hour Apart from the fact that it is nonsense to store a published date with a time part, the rules must be the same. 3) The date field is saved in a different format: the result of editing in the UI saves the date up to seconds (without fractional part) while when adding a book, the date is saved up to 1 millionth of a second. (let's not get distracted by observations 2 and 3, the real problem is observation 1) -=Wim=- |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,347
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I have no idea what you are doing.
1) <dc:date> is used for the published date 2) You cannot control the date field via the OPF since the date field always shows the date the book was added to calibre regardless of the value of calibre:timestamp It is nonsense to not put a time into a timestamp field. When you put in only a date what you are actually doing is saying the date is what you say it is +- 1 day depending on which timezone the person interpreting the date is in. Not to mentiont hat plenty of publications can have intra day publication dates. |
![]() |
![]() |
![]() |
#7 | |||
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Apr 2014
Location: Belgium
Device: Sony PRS-T1
|
I'm sorry, I'll try to give some more context. I created an EPUB with Sigil. In the metadata editor of Sigil I saw 3 dates: Date:Creation, Date:Modification and Date:Publication. In the book list of calibre I also see 3 dates: Date, Published and Modified. I assumed that these dates meant the same in both applications (I now know they don't). What I tried to do was to get calibre "read" the dates of the EPUB, so that I didn't have to modify them afterwards in calibre.
Yes. But if I have a book that was published say in 2010 and I add it in calibre, why does the Published column show today's date? I figured I did something wrong with the metadata in the EPUB so basically, that was my initial question: which tag do I have to use in the contents.opf of the EPUB so that calibre can recognise it? Quote:
Quote:
Assume a book was published on christmas and I would enter 2013-12-25 (remember I'm in time zone +2). I then take my library (which is on a thumb drive) and I open it on a computer in London (UTC) then all of a sudden the book *appears* to be published the day before christmas. What I want to say is that IMHO a publication date is a fixed date, regardless in which timezone you look at it. I don't want to be pedantic, but Dublin Core says that dc:date follows the YYYY-MM-DD format (see point 4.12. of http://dublincore.org/documents/usag...elements.shtml). The time part is not present. Quote:
-=Wim=- |
|||
![]() |
![]() |
![]() |
#8 | ||
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@WimmeR - You can control the format of the 3 dates that calibre keeps, including the inclusion of time, via Preferences->Tweaks->Control how dates are displayed
Quote:
Quote:
I'm not so bothered by date/time the book was added to calibre (timestamp), and even less by calibre's modified date because it can change 'unexpectedly' BR |
||
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre Metadata not same as EPub Meta | Brovig | Library Management | 30 | 12-01-2015 06:01 PM |
Writing Calibre Metadata directly into ePub files? | strongnc21 | Calibre | 5 | 09-09-2013 12:25 AM |
Insert metadata as page at start of book (epub to epub) | eosrose | Conversion | 12 | 08-09-2012 11:25 AM |
Calibre/ePub Metadata | carmenchu | Library Management | 5 | 09-07-2011 03:13 PM |
Metadata from calibre converted epub | wannabee | Kindle Formats | 0 | 03-01-2011 12:05 AM |