fix: remove space and / as artist separators, keep &
Separators: • · ; , & — space and / removed to avoid breaking multi-word artist names. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
e5bb2bf2d3
commit
f03c6dfabd
3 files changed
+3
-4
No files matched your search
@@ -13,7 +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, ';');
|
||||
}
|
||||
|
||||
|
||||
@@ -246,8 +246,7 @@ function _normalizeArtists(str, sep) {
|
||||
if (!str) return str;
|
||||
// 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);
|
||||
return str.split(/\s*[•·;,&]\s*/).map(s => s.trim()).filter(Boolean).join(sep);
|
||||
}
|
||||
|
||||
// Strip " - Topic" suffix YouTube Music appends to artist channel names
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user