mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-22 00:07:52 +01:00
Parse NFO trim final parsed description
This commit is contained in:
parent
36e00e8d6a
commit
d9584174ff
@ -60,7 +60,7 @@ function parseNfoMetadata(nfoText) {
|
|||||||
metadata.publishedYear = year
|
metadata.publishedYear = year
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
case 'position in series':
|
case 'position in series':
|
||||||
metadata.sequence = value
|
metadata.sequence = value
|
||||||
break
|
break
|
||||||
@ -84,11 +84,17 @@ function parseNfoMetadata(nfoText) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Trim leading/trailing whitespace for description
|
||||||
|
if (metadata.description) {
|
||||||
|
metadata.description = metadata.description.trim()
|
||||||
|
}
|
||||||
|
|
||||||
return metadata
|
return metadata
|
||||||
}
|
}
|
||||||
module.exports = { parseNfoMetadata }
|
module.exports = { parseNfoMetadata }
|
||||||
|
|
||||||
function extractYear(str) {
|
function extractYear(str) {
|
||||||
const match = str.match(/\d{4}/g)
|
const match = str.match(/\d{4}/g)
|
||||||
return match ? match[match.length-1] : null
|
return match ? match[match.length - 1] : null
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user