feat: accept space, &, / as artist separators in metadata editor

- Space as fallback separator on save when no explicit separator present
  (Artist1 Artist2 → Artist1;Artist2)
- & and / added to explicit separator set everywhere
- navidromeArtist (download path) also handles /

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-24 12:30:18 +02:00
1 parent 8a60ab2b98
commit e5bb2bf2d3
3 files changed
+6 -2

No files matched your search

+1
View File
@@ -13,6 +13,7 @@ function navidromeArtist(name) {
.replace(/\s+ft\.?\s+/gi, ';') .replace(/\s+ft\.?\s+/gi, ';')
.replace(/\s+featuring\s+/gi, ';') .replace(/\s+featuring\s+/gi, ';')
.replace(/\s+&\s+/g, ';') .replace(/\s+&\s+/g, ';')
.replace(/\s*\/\s*/g, ';')
.replace(/,\s*/g, ';'); .replace(/,\s*/g, ';');
} }
+4 -1
View File
@@ -244,7 +244,10 @@ app.post('/api/spotify/resolve', async (req, res) => {
// and rejoins with the canonical sep ("; " for track artist, ", " for album artist). // and rejoins with the canonical sep ("; " for track artist, ", " for album artist).
function _normalizeArtists(str, sep) { function _normalizeArtists(str, sep) {
if (!str) return str; 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 // Strip " - Topic" suffix YouTube Music appends to artist channel names
+1 -1
View File
@@ -240,7 +240,7 @@ document.addEventListener('click', e => {
// Track artist → "Serph; Zun" | Album artist → "Serph, Zun" // Track artist → "Serph; Zun" | Album artist → "Serph, Zun"
function _fmtArtists(str, sep) { function _fmtArtists(str, sep) {
if (!str) return ''; 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) { function _renderInfoModal(s) {