fix: use the US iTunes store everywhere for consistent artist naming

Search (web api.js) was JP-first, the download lookups were JP-first, and the Android
client was already US — so the same artist resolved inconsistently: sometimes kanji,
sometimes katakana, sometimes romaji, depending on which path and which store matched.

Switch everything to the US store:
- api.js itunesSearch → country=us (one fetch, matches the Android client)
- metadata.js lookupItunesTrackMeta → US only (drops the JP fetch: consistent names +
  halves the download's iTunes calls, which also eases the rate limit)
- searchItunesAlbumTracks → country=us
- remove the JP-katakana guards in the album/artist download paths (redundant now, and
  they wrongly romanized genuine Japanese artists like 羽岡佳 → "Kei Haneoka")

Titles still come from the source, so a Japanese title the user picked stays Japanese;
only iTunes-derived fields (album_artist, genre, year, artwork) follow the US store.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Opus 4.8 committed 2026-07-29 10:37:07 +02:00
1 parent d98978a6c7
commit 9c8b4775ea
5 files changed
+23 -32

No files matched your search

+6
View File
@@ -46,6 +46,12 @@ Backend runs in Docker (see `docker-compose.yml`); on the deploy host it lives a
## Download pipeline (hard-won knowledge)
- Downloads are **yt-dlp only** (the old squid.wtf/Qobuz backend was removed).
- **iTunes store = US everywhere** (`api.js` search, `metadata.js` `lookupItunesTrackMeta` /
`searchItunesAlbumTracks`). Was JP-first, which localized Western artists to katakana ("DJスネイク")
on some tracks and kept kanji on others → the *same* artist resolved differently between downloads.
US-only gives one consistent name per artist and halves the download's iTunes calls. Titles come
from the source, so a Japanese title the user picked stays Japanese; only iTunes-derived fields
(album\_artist, genre, year, artwork) follow the US store.
- **File naming:** `{NN - }Artist - Title.ext` with the release suffix stripped from the
title (no `- Single`/`- EP`). The **album folder keeps the full album name**. Original names
are used for folder, filename, and all main tags (artist/title/album/album\_artist) — even