fix(backend): fix-artist-sort uses kanji for folder/filename, romaji only for sort tags
Consistent with point 7: original (kanji) names in folder, filename, and main tags — romaji only in ARTISTSORT/ALBUMARTISTSORT. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
38d21cf2e0
commit
ff79428683
1 file changed
+2
-2
@@ -785,7 +785,7 @@ app.post('/api/fix-artist-sort', async (req, res) => {
|
|||||||
|
|
||||||
let done = 0, errors = 0;
|
let done = 0, errors = 0;
|
||||||
const errorDetails = [];
|
const errorDetails = [];
|
||||||
const safeArtistDir = sanitize(artistSort.split(/[,;&]/)[0].trim());
|
const safeArtistDir = sanitize(artistKanji.split(/[,;&]/)[0].trim());
|
||||||
|
|
||||||
for (const ndSong of songs) {
|
for (const ndSong of songs) {
|
||||||
try {
|
try {
|
||||||
@@ -840,7 +840,7 @@ app.post('/api/fix-artist-sort', async (req, res) => {
|
|||||||
// Split on first " - " or " – ": if 2+ segments, first is old artist, rest is title
|
// Split on first " - " or " – ": if 2+ segments, first is old artist, rest is title
|
||||||
const segments = afterPrefix.split(/\s+[-–—]\s+/);
|
const segments = afterPrefix.split(/\s+[-–—]\s+/);
|
||||||
const titlePart = segments.length >= 2 ? segments.slice(1).join(' - ') : afterPrefix;
|
const titlePart = segments.length >= 2 ? segments.slice(1).join(' - ') : afterPrefix;
|
||||||
const safeArtistFile = sanitize(artistSort.split(/[,;&]/)[0].trim());
|
const safeArtistFile = sanitize(artistKanji.split(/[,;&]/)[0].trim());
|
||||||
const safeTitlePart = sanitize(titlePart);
|
const safeTitlePart = sanitize(titlePart);
|
||||||
const newBasename = `${trackPrefix}${safeArtistFile} - ${safeTitlePart}${fileExt}`;
|
const newBasename = `${trackPrefix}${safeArtistFile} - ${safeTitlePart}${fileExt}`;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user