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

@ -1,5 +1,5 @@
const Logger = require('../../Logger')
const { areEquivalent, copyValue } = require('../../utils/index')
const { areEquivalent, copyValue, cleanStringForSearch } = require('../../utils/index')
class PodcastMetadata {
constructor(metadata) {
@ -94,7 +94,7 @@ class PodcastMetadata {
searchQuery(query) { // Returns key if match is found
var keysToCheck = ['title', 'author', 'itunesId', 'itunesArtistId']
for (var key of keysToCheck) {
if (this[key] && String(this[key]).toLowerCase().includes(query)) {
if (this[key] && cleanStringForSearch(String(this[key])).includes(query)) {
return {
matchKey: key,
matchText: this[key]