mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-22 00:07:52 +01:00
Moved getting xml meta entries to opf parser
This commit is contained in:
parent
60aeb23797
commit
4ac0bd6770
@ -56,12 +56,6 @@ const xmlToJSON = (xml) => {
|
|||||||
Logger.error(`[xmlToJSON] Error`, err)
|
Logger.error(`[xmlToJSON] Error`, err)
|
||||||
resolve(null)
|
resolve(null)
|
||||||
} else {
|
} else {
|
||||||
if (typeof results.package.metadata[0].meta != "undefined") {
|
|
||||||
results.package.metadata[0].meta = {}
|
|
||||||
for(var match of xml.matchAll(/<meta name="(?<name>.+)" content="(?<content>.+)"\/>/g)) {
|
|
||||||
results.package.metadata[0].meta[match.groups['name']] = [match.groups['content']]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
resolve(results)
|
resolve(results)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -90,6 +90,13 @@ module.exports.parseOpfMetadataXML = async (xml) => {
|
|||||||
metadata = metadata[0]
|
metadata = metadata[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof metadata.meta != "undefined") {
|
||||||
|
metadata.meta = {}
|
||||||
|
for(var match of xml.matchAll(/<meta name="(?<name>.+)" content="(?<content>.+)"\/>/g)) {
|
||||||
|
metadata.meta[match.groups['name']] = [match.groups['content']]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var creators = parseCreators(metadata)
|
var creators = parseCreators(metadata)
|
||||||
var data = {
|
var data = {
|
||||||
title: fetchTitle(metadata),
|
title: fetchTitle(metadata),
|
||||||
|
Loading…
Reference in New Issue
Block a user