mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-08 00:08:14 +01:00
Added try catch to opf fetchNarrators
This commit is contained in:
parent
4e329a3f8e
commit
4212251c78
@ -83,10 +83,12 @@ function fetchVolumeNumber(metadata) {
|
||||
function fetchNarrators(creators, metadata) {
|
||||
var roleNrt = fetchCreator(creators, 'nrt')
|
||||
if(typeof metadata.meta == "undefined" || roleNrt != null) return roleNrt
|
||||
var narratorsTag = fetchTagString(metadata.meta, "calibre:user_metadata:#narrators")
|
||||
if(narratorsTag == null) return narratorsTag
|
||||
var narratorsJSON = JSON.parse(narratorsTag.replace(/"/g,'"'))
|
||||
return narratorsJSON["#value#"].join(", ")
|
||||
try {
|
||||
var narratorsJSON = JSON.parse(fetchTagString(metadata.meta, "calibre:user_metadata:#narrators").replace(/"/g,'"'))
|
||||
return narratorsJSON["#value#"].join(", ")
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.parseOpfMetadataXML = async (xml) => {
|
||||
|
Loading…
Reference in New Issue
Block a user