mirror of
https://github.com/janeczku/calibre-web
synced 2024-12-18 14:10:30 +00:00
backup metadata 5th step
This commit is contained in:
parent
0f67e57be4
commit
04908e22fe
@ -93,7 +93,8 @@ class TaskBackupMetadata(CalibreTask):
|
|||||||
self.calibre_db.session.close()
|
self.calibre_db.session.close()
|
||||||
|
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
self.log.debug('Error creating metadata backup for book {}: '.format(book.id) + str(ex))
|
b = "NaN" if not hasattr(book, 'id') else book.id
|
||||||
|
self.log.debug('Error creating metadata backup for book {}: '.format(b) + str(ex))
|
||||||
self._handleError('Error creating metadata backup: ' + str(ex))
|
self._handleError('Error creating metadata backup: ' + str(ex))
|
||||||
self.calibre_db.session.rollback()
|
self.calibre_db.session.rollback()
|
||||||
self.calibre_db.session.close()
|
self.calibre_db.session.close()
|
||||||
@ -191,9 +192,10 @@ class TaskBackupMetadata(CalibreTask):
|
|||||||
etree.SubElement(metadata, "meta", name="calibre:series",
|
etree.SubElement(metadata, "meta", name="calibre:series",
|
||||||
content=str(str(b.name)),
|
content=str(str(b.name)),
|
||||||
nsmap=NSMAP)
|
nsmap=NSMAP)
|
||||||
etree.SubElement(metadata, "meta", name="calibre:series_index",
|
if book.series:
|
||||||
content=str(book.series_index),
|
etree.SubElement(metadata, "meta", name="calibre:series_index",
|
||||||
nsmap=NSMAP)
|
content=str(book.series_index),
|
||||||
|
nsmap=NSMAP)
|
||||||
etree.SubElement(metadata, "meta", name="calibre:timestamp",
|
etree.SubElement(metadata, "meta", name="calibre:timestamp",
|
||||||
content='{d.year:04}-{d.month:02}-{d.day:02}T{d.hour:02}:{d.minute:02}:{d.second:02}'.format(
|
content='{d.year:04}-{d.month:02}-{d.day:02}T{d.hour:02}:{d.minute:02}:{d.second:02}'.format(
|
||||||
d=book.timestamp),
|
d=book.timestamp),
|
||||||
|
Loading…
Reference in New Issue
Block a user