feat: album names use Navidrome sortName tag when showRomaji is on
dispAlbumName now takes the full album object and reads album.sortName directly — no kuromoji fallback, no backend translation. dispAlbum (song context) also drops the kuromoji fallback, keeping only the sortAlbum/albumSort file tag. Override list → Navidrome sort tag → raw Japanese name. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
4c3ec5726c
commit
e3987a6376
5 files changed
+19
-15
No files matched your search
+8
-4
@@ -178,11 +178,15 @@ export function dispArtistById(id, name) {
|
||||
if (sort) return sort;
|
||||
return _artistRomajiMap?.get(String(id)) || name || '';
|
||||
}
|
||||
export function dispAlbumName(name) {
|
||||
if (!S.cfg.showRomaji) return name || '';
|
||||
// Takes a full album object so it can read the Navidrome sortName tag.
|
||||
export function dispAlbumName(album) {
|
||||
const name = album?.name || '';
|
||||
if (!S.cfg.showRomaji) return name;
|
||||
const ov = getRomajiOverrides();
|
||||
if (name && ov[name]) return ov[name];
|
||||
return _albumRomajiMap?.get(name) || name || '';
|
||||
const sort = album?.sortName;
|
||||
if (sort && !_isJp(sort)) return sort;
|
||||
return name;
|
||||
}
|
||||
|
||||
// Synchronous lookup — returns index entry for a song ID, or null if not in index.
|
||||
@@ -215,7 +219,7 @@ export function dispAlbum(s) {
|
||||
if (s.album && ov[s.album]) return ov[s.album];
|
||||
const st = s.sortAlbum || s.albumSort;
|
||||
if (st && !_isJp(st)) return st;
|
||||
return romajiLookup(s.id)?.albumRomaji || s.album || '';
|
||||
return s.album || '';
|
||||
}
|
||||
// Returns [{name, id}] like parseArtists but with romaji display names when showRomaji is on.
|
||||
// Multi-artist romaji is collapsed into one entry since we can't reliably split the converted string.
|
||||
|
||||
Reference in new issue
Block a user