feat: romaji artist names, Apple Music autofill, romaji index invalidation

- Artist grid and detail header now show romaji names when toggle is on.
  Builds a Map<artistId, artistRomaji> from the existing song romaji index
  so no extra API call is needed.

- Apple Music autofill button added to edit modal next to MusicBrainz.
  Reuses the existing lookupItunesTrackMeta backend function via a new
  GET /api/itunes/lookup endpoint — fills album, year, genre, track#,
  and cover art.

- Romaji index is invalidated after every successful download so newly
  added songs appear with correct sort tags without requiring a page reload.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-27 12:26:51 +02:00
1 parent 212491aa89
commit b7afa19f70
6 files changed
+79 -9

No files matched your search

+4 -3
View File
@@ -6,7 +6,7 @@ import { playQueue, dlSongLocal, playPreview, toggleStar, parseArtists } from '.
import { showCtxMenu, openEditPlModal, openDlModal, closeSidebar, switchNavMode } from './ui.js';
import { closeNowPlaying, closeNpMenu } from './nowplaying.js';
import { makeCard, makeAlbumCard, makeSongItem, makeGlobalTrackItem, mkSection } from './components.js';
import { fetchRomajiIndex } from './api.js';
import { fetchRomajiIndex, dispArtistById } from './api.js';
import { loadSpotifyImporter } from './spotify.js';
import { loadSoundCloudImporter } from './soundcloud.js';
@@ -283,9 +283,10 @@ export async function loadArtists() {
try {
const r = await api('getArtists');
const all = (r.artists?.index || []).flatMap(i => i.artist || []);
if (S.cfg.showRomaji) await fetchRomajiIndex().catch(() => {});
g.innerHTML = '';
all.forEach(a => {
const c = makeCard(a.name, a.albumCount+' Alben', null, '🎤');
const c = makeCard(dispArtistById(a.id, a.name), a.albumCount+' Alben', null, '🎤');
c.classList.add('artist-card');
c.onclick = () => navigate('artist-detail', a);
g.appendChild(c);
@@ -344,7 +345,7 @@ function _makeTopsongRow(s, num, subtitle, list, idx) {
// ─── ARTIST DETAIL ───
export async function loadArtistDetail(artist) {
document.getElementById('artist-detail-name').textContent = artist.name;
document.getElementById('artist-detail-name').textContent = dispArtistById(artist.id, artist.name);
document.getElementById('artist-back-btn').onclick = () => _navGoBack();
const hero = document.getElementById('artist-detail-hero');