diff --git a/backend/lib/metadata.js b/backend/lib/metadata.js index 76989c7..98111e5 100644 --- a/backend/lib/metadata.js +++ b/backend/lib/metadata.js @@ -13,6 +13,7 @@ function navidromeArtist(name) { .replace(/\s+ft\.?\s+/gi, ';') .replace(/\s+featuring\s+/gi, ';') .replace(/\s+&\s+/g, ';') + .replace(/\s*\/\s*/g, ';') .replace(/,\s*/g, ';'); } diff --git a/backend/novasonic-server.js b/backend/novasonic-server.js index d519b2c..229de75 100644 --- a/backend/novasonic-server.js +++ b/backend/novasonic-server.js @@ -244,7 +244,10 @@ app.post('/api/spotify/resolve', async (req, res) => { // and rejoins with the canonical sep ("; " for track artist, ", " for album artist). function _normalizeArtists(str, sep) { if (!str) return str; - return str.split(/\s*[•·;,]\s*/).map(s => s.trim()).filter(Boolean).join(sep); + // If an explicit separator is present use it; otherwise fall back to splitting on spaces + // so the user can type "Artist1 Artist2" without a semicolon. + const splitter = /[•·;,&/]/.test(str) ? /\s*[•·;,&/]\s*/ : /\s+/; + return str.split(splitter).map(s => s.trim()).filter(Boolean).join(sep); } // Strip " - Topic" suffix YouTube Music appends to artist channel names diff --git a/src/ui.js b/src/ui.js index 8f426d1..080ad29 100644 --- a/src/ui.js +++ b/src/ui.js @@ -240,7 +240,7 @@ document.addEventListener('click', e => { // Track artist → "Serph; Zun" | Album artist → "Serph, Zun" function _fmtArtists(str, sep) { if (!str) return ''; - return str.split(/\s*[•·;,]\s*/).map(s => s.trim()).filter(Boolean).join(sep); + return str.split(/\s*[•·;,&/]\s*/).map(s => s.trim()).filter(Boolean).join(sep); } function _renderInfoModal(s) {