Update server/utils/parsers/parseOpfMetadata.js

This commit is contained in:
advplyr 2023-07-15 11:41:35 -05:00 committed by GitHub
parent 47b9ee557e
commit 2834f6077e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,8 +17,7 @@ function parseCreators(metadata) {
function fetchCreators(creators, role) {
if (!creators || !creators.length) return null
const creatorNames = creators.filter(c => c.role === role).map(c => c.value)
return creatorNames.filter((item, index) => creatorNames.indexOf(item) === index)
return [...new Set(creators.filter(c => c.role === role).map(c => c.value))]
}
function fetchTagString(metadata, tag) {