mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-30 23:59:39 +00:00
Update:Global library search strips periods, commas and other characters when matching #750
This commit is contained in:
parent
256a9322ef
commit
5b4d3f71f9
8 changed files with 20 additions and 26 deletions
|
|
@ -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()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue