mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-26 10:49:00 +02:00
Update:Author names ignore periods when checking for existing authors #993
This commit is contained in:
parent
ae4ac392c6
commit
be592a04d0
2 changed files with 11 additions and 1 deletions
|
@ -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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue