mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-09 07:14:52 +02:00
Update:Author names ignore periods when checking for existing authors #993
This commit is contained in:
@ -91,4 +91,13 @@ module.exports.parse = (nameString) => {
|
||||
nameLF: lastFirst, // String of comma separated last, first
|
||||
names: namesArray // Array of first last
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.checkNamesAreEqual = (name1, name2) => {
|
||||
if (!name1 || !name2) return false
|
||||
|
||||
// e.g. John H. Smith will be equal to John H Smith
|
||||
name1 = String(name1).toLowerCase().trim().replace(/\./g, '')
|
||||
name2 = String(name2).toLowerCase().trim().replace(/\./g, '')
|
||||
return name1 === name2
|
||||
}
|
Reference in New Issue
Block a user