mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-11-08 00:54:33 +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)
|
||||
resolve(null)
|
||||
} 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)
|
||||
}
|
||||
})
|
||||
|
@ -90,6 +90,13 @@ module.exports.parseOpfMetadataXML = async (xml) => {
|
||||
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 data = {
|
||||
title: fetchTitle(metadata),
|
||||
|
Loading…
Reference in New Issue
Block a user