fix: playlist matching for romaji-stored Japanese tracks + punctuation cleanup

- Clean Japanese punctuation (、。・) in romajiForStorage so it doesn't pass through
- Add POST /api/romaji-convert endpoint for batch title conversion
- Add romajiConvert() to api.js
- Add third fallback in _createNdPlaylist: convert Japanese title to romaji and
  search Navidrome with it (for songs already downloaded with romaji tags)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-25 01:20:37 +02:00
1 parent c7bebd5691
commit f1eabf7099
4 files changed
+48 -5

No files matched your search

+14
View File
@@ -68,6 +68,20 @@ export async function fetchRomajiIndex() {
export function invalidateRomajiIndex() { _romajiIndex = null; }
export async function romajiConvert(texts) {
if (!S.cfg.backendUrl || !texts.length) return texts;
try {
const r = await fetch(`${S.cfg.backendUrl}/api/romaji-convert`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ texts }),
});
if (!r.ok) return texts;
const { results } = await r.json();
return results;
} catch { return texts; }
}
// ─── ITUNES ───
// Route through backend proxy to avoid CORS; fall back to direct if no backend configured.
function _itunesBase() {