feat: keep Japanese in main tags, romaji in sort tags + frontend toggle

- Downloads now store original Japanese in TITLE/ARTIST/ALBUM tags
  so Apple Music, iTunes, YTM etc. all see the authentic original text
- Sort tags (TITLESORT/ARTISTSORT/ALBUMSORT) written with romaji for
  apps that use them for sorting/display
- iTunes-resolved English artist name used for ARTISTSORT and folder names
  when available (more accurate than kuromoji for known artists)
- rawArtist parameter added to downloadTrack so YTM search query uses
  the original Japanese channel name (fixes wrong song downloads)
- spotify.js: artistName preserved as original; itunesArtistName stored
  separately so the Spotify importer shows Japanese titles
- romaji index now includes titleRomaji/artistRomaji/albumRomaji fields
- Frontend: showRomaji setting (Settings > Bibliothek) — when on, player
  bar, now-playing, queue, and song lists all show romaji via index lookup
- refreshDisplayMode() updates all live UI when the toggle is saved

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-25 14:58:53 +02:00
1 parent f1eabf7099
commit 1aff19e319
10 files changed
+140 -55

No files matched your search

+12 -9
View File
@@ -130,15 +130,18 @@ async function buildRomajiIndex(ndUrl, user, pass) {
const index = songs
.filter(s => JP_RE.test(s.title) || JP_RE.test(s.artist) || JP_RE.test(s.album))
.map(s => ({
id: s.id,
r: [toRomaji(s.title), toRomaji(s.artist), toRomaji(s.album)].join(' '),
title: s.title,
artist: s.artist || '',
album: s.album || '',
coverArt: s.coverArt || '',
duration: s.duration || 0,
albumId: s.albumId || '',
artistId: s.artistId || '',
id: s.id,
r: [toRomaji(s.title), toRomaji(s.artist), toRomaji(s.album)].join(' '),
title: s.title,
artist: s.artist || '',
album: s.album || '',
titleRomaji: romajiForStorage(s.title) || s.title,
artistRomaji: romajiForStorage(s.artist) || s.artist || '',
albumRomaji: romajiForStorage(s.album) || s.album || '',
coverArt: s.coverArt || '',
duration: s.duration || 0,
albumId: s.albumId || '',
artistId: s.artistId || '',
}));
romajiCache.set(key, { ts: Date.now(), index });
return { fromCache: false, index };