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

+23
View File
@@ -570,6 +570,29 @@ app.post('/api/soundcloud/resolve', async (req, res) => {
}
});
// ─── ITUNES LOOKUP ───────────────────────────────────────────────────────────
app.get('/api/itunes/lookup', async (req, res) => {
const { artist, title } = req.query;
if (!artist || !title) return res.status(400).json({ error: 'artist and title required' });
try {
const meta = await lookupItunesTrackMeta(artist, title);
if (!meta.album && !meta.genre && !meta.year) return res.json({ found: false });
res.json({
found: true,
album: meta.album || undefined,
year: meta.year || undefined,
trackNum: meta.trackNum || undefined,
totalTracks: meta.totalTracks || undefined,
genre: meta.genre || undefined,
coverUrl: meta.artworkUrl || undefined,
artist: meta.itunesArtistName || undefined,
});
} catch (e) {
console.error('[itunes/lookup]', e.message);
res.status(500).json({ error: e.message });
}
});
// ─── MUSICBRAINZ LOOKUP ──────────────────────────────────────────────────────
app.get('/api/musicbrainz/lookup', async (req, res) => {
const { artist, title } = req.query;