Use Node.js path parser to extract the stem in the chats search.
| @@ -785,9 +785,9 @@ router.post('/search', validateAvatarUrlMiddleware, function (request, response) | ||
| 785 | 785 | |
| 786 | 786 | // Search through title and messages of the chat |
| 787 | 787 | const fragments = query.trim().toLowerCase().split(/\s+/).filter(x => x); |
| 788 | 788 | const text = [chatFile.path.splitparse(/[\\/]/)chatFile.pop(path).replace(/.jsonl$/, '')name, |
| 789 | 789 | ...messages.map(message => message?.mes)].join('"\n'").toLowerCase(); |
| 790 | 790 | const hasMatch = fragments.every(fragment => (text).includes(fragment)); |
| 791 | 791 | |
| 792 | 792 | if (hasMatch) { |
| 793 | 793 | results.push({ |