fix: romaji for album names + Japanese playlist track matching
- ytdlp.js + novasonic-server.js: apply romajiForStorage to album tag and folder/rename paths (was only applied to artist/title before) - ui.js: _createNdPlaylist falls back to romaji index for Japanese titles since Navidrome search3 doesn't index Japanese text properly Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
88533b8835
commit
392da7e021
3 files changed
+23
-9
No files matched your search
@@ -53,8 +53,9 @@ async function downloadTrack({ jobId, artist, albumArtist, title, album, year, t
|
||||
const mainArtistRomaji = romajiForStorage(mainArtist) || mainArtist;
|
||||
const artistRomaji = romajiForStorage(artist) || artist;
|
||||
const titleRomaji = romajiForStorage(title) || title;
|
||||
const albumRomaji = album ? (romajiForStorage(album) || album) : null;
|
||||
const safeArtist = sanitize(mainArtistRomaji.split(/[,;&]/)[0].trim());
|
||||
const safeAlbum = sanitize(album || 'Singles');
|
||||
const safeAlbum = sanitize(albumRomaji || 'Singles');
|
||||
const dir = path.join(outputDir || CONFIG.musicPath, safeArtist, safeAlbum);
|
||||
fs.mkdirSync(dir, { recursive: true });
|
||||
|
||||
@@ -306,6 +307,7 @@ async function embedMetadata({ jobId, audioFile, dir, trackPrefix, safeTitle, ar
|
||||
const storedTitle = romajiForStorage(title) || title;
|
||||
const storedArtist = romajiForStorage(navidromeArtist(artist)) || navidromeArtist(artist);
|
||||
const storedAlbumArtist = romajiForStorage(mainArtist.replace(/\s+&\s+/g, ', ')) || mainArtist.replace(/\s+&\s+/g, ', ');
|
||||
const storedAlbum = album ? (romajiForStorage(album) || album) : null;
|
||||
ffArgs.push(
|
||||
'-c', 'copy',
|
||||
'-map_metadata', '-1',
|
||||
@@ -314,7 +316,7 @@ async function embedMetadata({ jobId, audioFile, dir, trackPrefix, safeTitle, ar
|
||||
'-metadata', `artist=${storedArtist}`,
|
||||
'-metadata', `album_artist=${storedAlbumArtist}`,
|
||||
);
|
||||
if (album) ffArgs.push('-metadata', `album=${album}`);
|
||||
if (storedAlbum) ffArgs.push('-metadata', `album=${storedAlbum}`);
|
||||
if (year) ffArgs.push('-metadata', `date=${String(year)}`);
|
||||
if (trackNum) ffArgs.push('-metadata', `track=${totalTracks ? `${trackNum}/${totalTracks}` : String(trackNum)}`);
|
||||
if (totalTracks) ffArgs.push('-metadata', `totaltracks=${String(totalTracks)}`);
|
||||
|
||||
Reference in new issue
Block a user