mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix regression that was removing pubdate/timestamp from converted books
This commit is contained in:
parent
335f2147e5
commit
431c60edd0
@ -455,7 +455,7 @@ class Metadata(object):
|
||||
'description', 'format', 'identifier', 'language',
|
||||
'publisher', 'relation', 'rights', 'source',
|
||||
'subject', 'title', 'type'])
|
||||
CALIBRE_TERMS = set(['series', 'series_index', 'rating'])
|
||||
CALIBRE_TERMS = set(['series', 'series_index', 'rating', 'timestamp'])
|
||||
OPF_ATTRS = {'role': OPF('role'), 'file-as': OPF('file-as'),
|
||||
'scheme': OPF('scheme'), 'event': OPF('event'),
|
||||
'type': XSI('type'), 'lang': XML('lang'), 'id': 'id'}
|
||||
|
@ -7,6 +7,7 @@ __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import os
|
||||
from datetime import datetime
|
||||
|
||||
def meta_info_to_oeb_metadata(mi, m, log):
|
||||
if mi.title:
|
||||
@ -56,6 +57,15 @@ def meta_info_to_oeb_metadata(mi, m, log):
|
||||
m.clear('subject')
|
||||
for t in mi.tags:
|
||||
m.add('subject', t)
|
||||
if mi.pubdate is not None:
|
||||
m.clear('date')
|
||||
m.add('date', mi.pubdate.isoformat())
|
||||
if mi.timestamp is not None:
|
||||
m.clear('timestamp')
|
||||
m.add('timestamp', mi.timestamp.isoformat())
|
||||
if not m.timestamp:
|
||||
m.add('timestamp', datetime.utcnow().isoformat())
|
||||
|
||||
|
||||
|
||||
class MergeMetadata(object):
|
||||
|
Loading…
x
Reference in New Issue
Block a user