Skip to content

Commit

Permalink
fix: body undefinded
Browse files Browse the repository at this point in the history
  • Loading branch information
LynMoe committed Apr 18, 2021
1 parent a5f7b53 commit 14bd643
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 17 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ module.exports = {
excludePlaylist: [],
// 需要同步的歌单
syncPlaylist: [
233333
233333,
'all' // 当数组中存在字符串 all 时,程序会将所有可编辑的歌单添加到监控列表中
],

// 是否下载收藏的专辑
Expand Down
3 changes: 2 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ if (!fs.existsSync(path.resolve(__root, '.azusa/'))) {

// 处理播放器歌单变动
const playlistName = config('prefix', []).playlist + playlistInfo.name
const needSync = (playlistInfo.creator.userId === api._uid) && config('syncPlaylist', []).includes(playlistId)
const syncConfig = config('syncPlaylist', [])
const needSync = (playlistInfo.creator.userId === api._uid) && (syncConfig.includes(playlistId) || syncConfig.includes('all'))

if (needSync) {
const filePath = path.resolve(__root, '.azusa/') + `/${playlistId}.json`
Expand Down
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "@kawaiilab/azusa",
"version": "1.1.1",
"version": "1.1.2",
"description": "For and by music lover",
"main": "app.js",
"bin": {
"azusa": "./app.js"
},
"scripts": {
"start": "node app.js",
"build": "rm -fr ./dist && ./node_modules/.bin/pkg -t node14-macos-x64 app.js -o ./dist/azusa-macos-x64 --no-bytecode --public --public-packages '*' && ./node_modules/.bin/pkg -t node14-win-x64 app.js -o ./dist/azusa-win-x64 --no-bytecode --public --public-packages '*' && ./node_modules/.bin/pkg -t node14-win-x86 app.js -o ./dist/azusa-win-x86 --no-bytecode --public --public-packages '*' && ./node_modules/.bin/pkg -t node14-linux-x64 app.js -o ./dist/azusa-linux-x64 --no-bytecode --public --public-packages '*'"
Expand Down
4 changes: 3 additions & 1 deletion source/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ module.exports = {
br: config('bitRate', 999000),
cookie: this._cookie
})
logger.debug(result)
result = JSON.parse(result.body.toString())

const trackUrl = result.data[0]
Expand All @@ -196,6 +197,7 @@ module.exports = {
id: trackId,
cookie: this._cookie
})
logger.debug(result)
result = result.body

return result
Expand All @@ -208,7 +210,7 @@ module.exports = {
pid: playlistId,
tracks: `${trackId}`
})
result = result.body
logger.debug(result)

return result
}
Expand Down
2 changes: 1 addition & 1 deletion source/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = {
logger.debug('MP3 meatadata', tags)
const result = nodeID3.write(tags, trackPath)
if (result) {
logger.debug('Metadata writed.')
logger.debug('Metadata written.')
} else {
logger.warn('Write metadata failed.')
}
Expand Down

0 comments on commit 14bd643

Please sign in to comment.