mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-04-25 23:06:43 +02:00
Update:Global library search strips periods, commas and other characters when matching #750
This commit is contained in:
@@ -210,4 +210,4 @@ module.exports.sanitizeFilename = (filename, colonReplacement = ' - ') => {
|
||||
}
|
||||
|
||||
return sanitized
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,4 +129,10 @@ module.exports.encodeUriPath = (path) => {
|
||||
module.exports.toNumber = (val, fallback = 0) => {
|
||||
if (isNaN(val) || val === null) return fallback
|
||||
return Number(val)
|
||||
}
|
||||
|
||||
module.exports.cleanStringForSearch = (str) => {
|
||||
if (!str) return ''
|
||||
// Remove ' . ` " ,
|
||||
return str.toLowerCase().replace(/[\'\.\`\",]/g, '').trim()
|
||||
}
|
||||
Reference in New Issue
Block a user