feat: 更新网易云音乐API版本并增强日志记录
更新NeteaseCloudMusicApi至最新版本4.28.0以获取最新功能 在wycloud音乐平台服务中添加详细日志记录,包括上传状态、错误信息和响应数据 添加.claude本地配置文件设置基础权限
This commit is contained in:
12
.claude/settings.local.json
Normal file
12
.claude/settings.local.json
Normal 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
2902
backend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -17,13 +17,13 @@
|
||||
},
|
||||
"homepage": "https://github.com/foamzou/personal-music-assistant#readme",
|
||||
"dependencies": {
|
||||
"NeteaseCloudMusicApi": "4.6.7",
|
||||
"body-parser": "^1.19.1",
|
||||
"consola": "^2.15.3",
|
||||
"cors": "^2.8.5",
|
||||
"express": "^4.17.2",
|
||||
"got": "11",
|
||||
"md5": "^2.3.0",
|
||||
"NeteaseCloudMusicApi": "^4.28.0",
|
||||
"node-schedule": "^2.1.1",
|
||||
"uuid": "^8.3.2"
|
||||
},
|
||||
|
||||
@@ -17,14 +17,25 @@ async function uploadSong(uid, filePath) {
|
||||
},
|
||||
});
|
||||
if (response === false) {
|
||||
logger.error(`[Upload] safeRequest failed, uid: ${uid}, file: ${path.basename(filePath)}`);
|
||||
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) {
|
||||
logger.error(`[Upload] No privateCloud field in response, uid: ${uid}, file: ${path.basename(filePath)}`, {
|
||||
fullResponse: JSON.stringify(response, null, 2)
|
||||
});
|
||||
return false;
|
||||
}
|
||||
const songInfo = response.privateCloud.simpleSong;
|
||||
|
||||
|
||||
logger.info(`[Upload] Success, songId: ${songInfo.id}, matched: ${songInfo.ar[0].id !== 0 && songInfo.al.id !== 0}`);
|
||||
return {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user