mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
EPUB: redo metadata parsing
- Support the `prefix` attribute (for the `property` attr on `<meta>`) - Localized titles, names (including `sortAs`) - `belongsTo`, including `calibre:series` - `altIdentifier`, converted to URN where possible - Remove `producer`. It's now `contributor` with `role: 'bkp'`. NOTE: this is a breaking change if you assumed that `title` will always be a string, `author` will always be an array, etc.
This commit is contained in:
@@ -248,8 +248,12 @@ export const makeFB2 = async blob => {
|
||||
language: getElementText($('title-info lang')),
|
||||
author: $$('title-info author').map(getPerson),
|
||||
translator: $$('title-info translator').map(getPerson),
|
||||
producer: $$('document-info author').map(getPerson)
|
||||
.concat($$('document-info program-used').map(getElementText)),
|
||||
contributor: $$('document-info author').map(getPerson)
|
||||
// techincially the program probably shouldn't get the `bkp` role
|
||||
// but it has been so used by calibre, so ¯\_(ツ)_/¯
|
||||
.concat($$('document-info program-used').map(getElementText))
|
||||
.map(x => Object.assign(typeof x === 'string' ? { name: x } : x,
|
||||
{ role: 'bkp' })),
|
||||
publisher: getElementText($('publish-info publisher')),
|
||||
published: getDate($('title-info date')),
|
||||
modified: getDate($('document-info date')),
|
||||
|
||||
Reference in New Issue
Block a user