fix: use iTunes names instead of kuromoji for Spotify Japanese tracks
Search iTunes with original Japanese names (accurate) rather than pre-converting with kuromoji (inaccurate for uncommon names/readings). iTunes returns the correct English artist name and title directly. Also run iTunes enrichment for single-track Spotify imports. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
446c583f7f
commit
36b09856ed
2 files changed
+2
-9
No files matched your search
@@ -225,13 +225,6 @@ app.post('/api/spotify/resolve', async (req, res) => {
|
||||
setTimeout(() => reject(new Error('Zeitüberschreitung — Spotify API antwortet nicht (>120s)')), 120000)
|
||||
);
|
||||
const data = await Promise.race([_resolveSpotifyViaSpotdl(url), timeout]);
|
||||
// Normalize Japanese artist/title names to romaji before sending to frontend
|
||||
if (data.tracks) {
|
||||
for (const t of data.tracks) {
|
||||
if (t.artistName) t.artistName = romajiForStorage(t.artistName) || t.artistName;
|
||||
if (t.trackName) t.trackName = romajiForStorage(t.trackName) || t.trackName;
|
||||
}
|
||||
}
|
||||
res.json(data);
|
||||
} catch(e) {
|
||||
console.error('[spotify/resolve]', e.message);
|
||||
|
||||
Reference in new issue
Block a user