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:
1 parent
8a60ab2b98
commit
e5bb2bf2d3
3 files changed
+6
-2
No files matched your search
@@ -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, ';');
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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