mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
@@ -224,7 +224,7 @@ const getMetadata = opf => {
|
|||||||
}
|
}
|
||||||
const makeContributor = x => x ? ({
|
const makeContributor = x => x ? ({
|
||||||
name: makeLanguageMap(x),
|
name: makeLanguageMap(x),
|
||||||
sortAs: makeLanguageMap(x.props?.['file-as']?.[0]),
|
sortAs: makeLanguageMap(x.props?.['file-as']?.[0]) ?? x.attrs['file-as'],
|
||||||
role: x.props?.role?.filter(x => x.scheme === PREFIX.marc + 'relators')
|
role: x.props?.role?.filter(x => x.scheme === PREFIX.marc + 'relators')
|
||||||
?.map(x => x.value) ?? [x.attrs.role],
|
?.map(x => x.value) ?? [x.attrs.role],
|
||||||
code: prop(x, 'term') ?? x.attrs.term,
|
code: prop(x, 'term') ?? x.attrs.term,
|
||||||
@@ -262,7 +262,7 @@ const getMetadata = opf => {
|
|||||||
identifier: getIdentifier(opf),
|
identifier: getIdentifier(opf),
|
||||||
title: makeLanguageMap(mainTitle),
|
title: makeLanguageMap(mainTitle),
|
||||||
sortAs: makeLanguageMap(mainTitle?.props?.['file-as']?.[0])
|
sortAs: makeLanguageMap(mainTitle?.props?.['file-as']?.[0])
|
||||||
?? makeLanguageMap(mainTitle?.attrs?.['file-as'])
|
?? mainTitle?.attrs?.['file-as']
|
||||||
?? legacyMeta?.['calibre:title_sort'],
|
?? legacyMeta?.['calibre:title_sort'],
|
||||||
subtitle: dc.title?.find(x => prop(x, 'title-type') === 'subtitle')?.value,
|
subtitle: dc.title?.find(x => prop(x, 'title-type') === 'subtitle')?.value,
|
||||||
language: dc.language?.map(x => x.value),
|
language: dc.language?.map(x => x.value),
|
||||||
|
|||||||
Reference in New Issue
Block a user