Update:Global library search strips periods, commas and other characters when matching #750

This commit is contained in:
advplyr 2022-06-26 15:46:16 -05:00
parent 256a9322ef
commit 5b4d3f71f9
8 changed files with 20 additions and 26 deletions

View file

@ -210,4 +210,4 @@ module.exports.sanitizeFilename = (filename, colonReplacement = ' - ') => {
}
return sanitized
}
}

View file

@ -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()
}