fix: match-filter trailing-s optional + playlist search fallback for special chars
- buildTitleKeywords: append '?' to keywords ending in 's' so regex "Whispers?" matches both "Whisper" (YouTube title) and "Whispers" (iTunes title) — fixes NoAki Whispers downloading wrong track - _createNdPlaylist: if artist+title search returns no title match, retry with title-only query so tracks with special chars in artist name (e.g. "Kløn") are still found in Navidrome Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
0a7591a690
commit
971cadd8fa
2 files changed
+12
-2
No files matched your search
@@ -83,7 +83,9 @@ function buildTitleKeywords(title) {
|
||||
.filter(w => w.length >= 3 && !VARIANT_WORDS.has(w.toLowerCase()) && !STOPWORDS.has(w.toLowerCase()));
|
||||
const main = words.sort((a, b) => b.length - a.length)[0] || '';
|
||||
const qualifier = lower.includes('mix') ? MIX_QUALIFIERS.find(q => lower.includes(q)) : null;
|
||||
const result = main ? [main] : [];
|
||||
// Make trailing 's' optional so "Whispers?" matches both "Whisper" and "Whispers" in yt-dlp regex
|
||||
const toPattern = w => (w.length >= 4 && w.endsWith('s')) ? w + '?' : w;
|
||||
const result = main ? [toPattern(main)] : [];
|
||||
if (qualifier && main.toLowerCase() !== qualifier) result.push(qualifier);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user