From 6fa9751fb6ebb39501d9ac208bbe9af775ea396b Mon Sep 17 00:00:00 2001 From: Honey Date: Wed, 27 May 2026 23:14:46 +0200 Subject: [PATCH] fix: log music root in file-not-found error for diagnosis Co-Authored-By: Claude Sonnet 4.6 --- backend/novasonic-server.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/novasonic-server.js b/backend/novasonic-server.js index 13099d6..348591b 100644 --- a/backend/novasonic-server.js +++ b/backend/novasonic-server.js @@ -762,14 +762,17 @@ app.post('/api/edit-metadata', async (req, res) => { // 2. Exact recursive search under CONFIG.musicPath. // 3. Fuzzy dir search: same dir, matching track-number prefix or title stem. if (!fs.existsSync(filePath)) { - const rebased = _rebasePath(filePath, CONFIG.musicPath); - const fileName = path.basename(filePath); + const rebased = _rebasePath(filePath, CONFIG.musicPath); + const fileName = path.basename(filePath); const rebasedDir = rebased ? path.dirname(rebased) : null; const found = rebased || _findFileRecursive(CONFIG.musicPath, fileName) || (rebasedDir && _findFileInDir(rebasedDir, fileName)); if (found) { filePath = found; } - else return res.status(404).json({ error: `File not found: ${filePath}` }); + else { + console.warn(`[edit-metadata] File not found. nd_path=${filePath} music_root=${CONFIG.musicPath} rebased=${rebased}`); + return res.status(404).json({ error: `File not found: ${filePath} (music root: ${CONFIG.musicPath})` }); + } } // Resolve artwork: base64 > URL