Merge pull request #3729 from Erquint/staging Use Node.js path parser to extract the filename stem in the chats search.

c047e1acd95f6d1b8c452b1be470bd4b2f3e48de

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +1 -1Ignore whitespace
src/endpoints/chats.js+1 -1
@@ -785,7 +785,7 @@ router.post('/search', validateAvatarUrlMiddleware, function (request, response)
785785
786786 // Search through title and messages of the chat
787787 const fragments = query.trim().toLowerCase().split(/\s+/).filter(x => x);
788788 const text = [chatFile.path.splitparse(/[\\/]/)chatFile.pop(path).replace(/.jsonl$/, '')name,
789789 ...messages.map(message => message?.mes)].join('\n').toLowerCase();
790790 const hasMatch = fragments.every(fragment => text.includes(fragment));
791791