From 77bbb18c8df81235308cbf95bfeb04e224d006a6 Mon Sep 17 00:00:00 2001 From: Honey Date: Fri, 19 Jun 2026 11:32:46 +0200 Subject: [PATCH] chore(backend): include resolved path in delete-song "file not found" error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The delete-song endpoint returned a bare "File not found on disk" with no context, making path-resolution mismatches impossible to diagnose. Now reports the Navidrome path, music root, and searched filename — matching the detail the edit-metadata endpoint already provides. Co-Authored-By: Claude Opus 4.8 --- backend/novasonic-server.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/novasonic-server.js b/backend/novasonic-server.js index 4bddf8e..b415e8f 100644 --- a/backend/novasonic-server.js +++ b/backend/novasonic-server.js @@ -1341,6 +1341,7 @@ app.post('/api/delete-song', async (req, res) => { return res.status(502).json({ error: `Navidrome lookup failed: ${e.message}` }); } + const ndPath = filePath; // path exactly as Navidrome reported it (for diagnostics) if (!path.isAbsolute(filePath)) filePath = path.join(CONFIG.musicPath, filePath); if (!fs.existsSync(filePath)) { const fileName = path.basename(filePath); @@ -1350,7 +1351,9 @@ app.post('/api/delete-song', async (req, res) => { || _findFileInDir(path.dirname(filePath), fileName) || _findFileByStemOrRomaji(CONFIG.musicPath, titleStem); if (found) filePath = found; - else return res.status(404).json({ error: 'File not found on disk' }); + else return res.status(404).json({ + error: `File not found on disk. Navidrome path: "${ndPath}" — music root: "${CONFIG.musicPath}" — searched for: "${fileName}"`, + }); } // Safety: file must be inside the music root and must be an audio file