use fuzzy matching for host and episode searches
This commit is contained in:
18
index.js
18
index.js
@@ -45,7 +45,14 @@ function formatEpisode(episode, includeNotes = false) {
|
||||
const host = dataLoader.getHost(episode.hostid);
|
||||
const seriesInfo = episode.series !== 0 ? dataLoader.getSeries(episode.series) : null;
|
||||
|
||||
let result = `# HPR${String(episode.id).padStart(4, '0')}: ${episode.title}
|
||||
let result = `# HPR${String(episode.id).padStart(4, '0')}: ${episode.title}`;
|
||||
|
||||
// Add match type indicator for fuzzy matches
|
||||
if (episode.matchType === 'fuzzy') {
|
||||
result += ` *(fuzzy match, distance: ${episode.matchDistance})*`;
|
||||
}
|
||||
|
||||
result += `
|
||||
|
||||
**Date:** ${episode.date}
|
||||
**Host:** ${host?.host || 'Unknown'} (ID: ${episode.hostid})
|
||||
@@ -606,7 +613,14 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
};
|
||||
}
|
||||
|
||||
let text = `# ${host.host}
|
||||
let text = `# ${host.host}`;
|
||||
|
||||
// Add match type indicator for fuzzy matches
|
||||
if (host.matchType === 'fuzzy') {
|
||||
text += ` *(fuzzy match, distance: ${host.matchDistance})*`;
|
||||
}
|
||||
|
||||
text += `
|
||||
|
||||
**Host ID:** ${host.hostid}
|
||||
**Email:** ${host.email}
|
||||
|
||||
Reference in New Issue
Block a user