feat: 更新网易云音乐API版本并增强日志记录

更新NeteaseCloudMusicApi至最新版本4.28.0以获取最新功能
在wycloud音乐平台服务中添加详细日志记录,包括上传状态、错误信息和响应数据
添加.claude本地配置文件设置基础权限
This commit is contained in:
史悦
2026-01-08 11:27:19 +08:00
parent dcfd9cc5be
commit e3c8a02669
4 changed files with 2928 additions and 3 deletions

View File

@@ -0,0 +1,12 @@
{
"permissions": {
"allow": [
"Bash(find:*)",
"WebSearch",
"WebFetch(domain:www.npmjs.com)",
"Bash(npm view:*)",
"Bash(npm install:*)",
"Bash(node -e:*)"
]
}
}

2902
backend/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -17,13 +17,13 @@
}, },
"homepage": "https://github.com/foamzou/personal-music-assistant#readme", "homepage": "https://github.com/foamzou/personal-music-assistant#readme",
"dependencies": { "dependencies": {
"NeteaseCloudMusicApi": "4.6.7",
"body-parser": "^1.19.1", "body-parser": "^1.19.1",
"consola": "^2.15.3", "consola": "^2.15.3",
"cors": "^2.8.5", "cors": "^2.8.5",
"express": "^4.17.2", "express": "^4.17.2",
"got": "11", "got": "11",
"md5": "^2.3.0", "md5": "^2.3.0",
"NeteaseCloudMusicApi": "^4.28.0",
"node-schedule": "^2.1.1", "node-schedule": "^2.1.1",
"uuid": "^8.3.2" "uuid": "^8.3.2"
}, },

View File

@@ -17,14 +17,25 @@ async function uploadSong(uid, filePath) {
}, },
}); });
if (response === false) { if (response === false) {
logger.error(`[Upload] safeRequest failed, uid: ${uid}, file: ${path.basename(filePath)}`);
return false; return false;
} }
logger.debug('uploadSong\'s resonse: ', response) logger.info(`[Upload] Response received for ${path.basename(filePath)}:`, {
hasPrivateCloud: !!response.privateCloud,
code: response.code,
message: response.message || response.msg,
keys: Object.keys(response),
});
if (!response.privateCloud) { if (!response.privateCloud) {
logger.error(`[Upload] No privateCloud field in response, uid: ${uid}, file: ${path.basename(filePath)}`, {
fullResponse: JSON.stringify(response, null, 2)
});
return false; return false;
} }
const songInfo = response.privateCloud.simpleSong; const songInfo = response.privateCloud.simpleSong;
logger.info(`[Upload] Success, songId: ${songInfo.id}, matched: ${songInfo.ar[0].id !== 0 && songInfo.al.id !== 0}`);
return { return {
songId: songInfo.id, songId: songInfo.id,
matched: songInfo.ar[0].id !== 0 && songInfo.al.id !== 0, // It's matched the song on wyMusic if singer and album has info matched: songInfo.ar[0].id !== 0 && songInfo.al.id !== 0, // It's matched the song on wyMusic if singer and album has info