Skip to content

Commit

Permalink
EPUB: fix opf:file-as
Browse files Browse the repository at this point in the history
Fixes #39
  • Loading branch information
johnfactotum committed Nov 3, 2024
1 parent 519c032 commit 24187b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions epub.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const getMetadata = opf => {
}
const makeContributor = x => 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')
?.map(x => x.value) ?? [x.attrs.role],
code: prop(x, 'term') ?? x.attrs.term,
Expand Down Expand Up @@ -262,7 +262,7 @@ const getMetadata = opf => {
identifier: getIdentifier(opf),
title: makeLanguageMap(mainTitle),
sortAs: makeLanguageMap(mainTitle?.props?.['file-as']?.[0])
?? makeLanguageMap(mainTitle?.attrs?.['file-as'])
?? mainTitle?.attrs?.['file-as']
?? legacyMeta?.['calibre:title_sort'],
subtitle: dc.title?.find(x => prop(x, 'title-type') === 'subtitle')?.value,
language: dc.language?.map(x => x.value),
Expand Down

1 comment on commit 24187b7

@routeone34
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Please sign in to comment.