New data model Book media type contains Audiobooks updates

This commit is contained in:
advplyr 2022-03-17 12:25:12 -05:00
parent 1dde02b170
commit c4eeb1cfb7
30 changed files with 347 additions and 247 deletions

View file

@ -27,7 +27,16 @@ function checkIsALastName(name) {
return false
}
module.exports = (nameString) => {
// Handle name already in First Last format and return Last, First
module.exports.nameToLastFirst = (firstLast) => {
var nameObj = parseName(firstLast)
if (!nameObj.last_name) return nameObj.first_name
else if (!nameObj.first_name) return nameObj.last_name
return `${nameObj.last_name}, ${nameObj.first_name}`
}
// Handle any name string
module.exports.parse = (nameString) => {
if (!nameString) return null
var splitNames = []