mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-02-28 21:19:42 +00:00
support isbn tags in dc:source
This commit is contained in:
parent
52a0b61b97
commit
989255e957
2 changed files with 15 additions and 1 deletions
|
|
@ -65,7 +65,8 @@ function parseIdentifier(metaTags, identifierType) {
|
|||
|
||||
const identifierValues = [
|
||||
...getValues(metaTags, 'dc:identifier'),
|
||||
...getValues(metaTags, 'ncc:identifier')
|
||||
...getValues(metaTags, 'ncc:identifier'),
|
||||
...(identifierType === 'isbn' ? getValues(metaTags, 'dc:source') : [])
|
||||
]
|
||||
for (const identifier of identifierValues) {
|
||||
if (identifierType === 'isbn' && /isbn/i.test(identifier)) {
|
||||
|
|
|
|||
|
|
@ -52,6 +52,19 @@ describe('parseDaisyMetadata', () => {
|
|||
expect(result.title).to.equal('Title From Head')
|
||||
})
|
||||
|
||||
it('parses isbn from dc:source in DAISY ncc.html', () => {
|
||||
const nccHtml = `
|
||||
<html>
|
||||
<head>
|
||||
<meta name="dc:source" content="ISBN 978-0-553-38016-3">
|
||||
</head>
|
||||
</html>
|
||||
`
|
||||
|
||||
const result = parseDaisyMetadata(nccHtml)
|
||||
expect(result.isbn).to.equal('978-0-553-38016-3')
|
||||
})
|
||||
|
||||
it('parses chapter names from heading entries in ncc.html', () => {
|
||||
const nccHtml = `
|
||||
<html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue