mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Merge pull request #1906 from warnwar/master
stop opf importer from adding duplicate info
This commit is contained in:
commit
9439acf300
@ -17,7 +17,7 @@ function parseCreators(metadata) {
|
||||
|
||||
function fetchCreators(creators, role) {
|
||||
if (!creators || !creators.length) return null
|
||||
return creators.filter(c => c.role === role).map(c => c.value)
|
||||
return [...new Set(creators.filter(c => c.role === role).map(c => c.value))]
|
||||
}
|
||||
|
||||
function fetchTagString(metadata, tag) {
|
||||
@ -92,7 +92,7 @@ function fetchDescription(metadata) {
|
||||
|
||||
function fetchGenres(metadata) {
|
||||
if (!metadata['dc:subject'] || !metadata['dc:subject'].length) return []
|
||||
return metadata['dc:subject'].map(g => typeof g === 'string' ? g : null).filter(g => !!g)
|
||||
return [...new Set(metadata['dc:subject'].filter(g => typeof g === 'string'))]
|
||||
}
|
||||
|
||||
function fetchLanguage(metadata) {
|
||||
@ -122,7 +122,7 @@ function fetchNarrators(creators, metadata) {
|
||||
|
||||
function fetchTags(metadata) {
|
||||
if (!metadata['dc:tag'] || !metadata['dc:tag'].length) return []
|
||||
return metadata['dc:tag'].filter(tag => (typeof tag === 'string'))
|
||||
return [...new Set(metadata['dc:tag'].filter(tag => typeof tag === 'string'))]
|
||||
}
|
||||
|
||||
function stripPrefix(str) {
|
||||
|
Loading…
Reference in New Issue
Block a user