Skip to content

Commit

Permalink
fix ...
Browse files Browse the repository at this point in the history
  • Loading branch information
a632079 committed Mar 10, 2018
1 parent 35e5c76 commit 6a6f4f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions config.example.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "",
"url": "",
"server": {
"host": "127.0.0.1",
"port": "8000"
Expand Down
9 changes: 5 additions & 4 deletions src/controllers/netease.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const async = require('async')
const { MusicClient } = require('netease-music-sdk')
const pify = require('pify')
const cache = require('../cache')
const nconf = require('nconf')
const nm = new NeteaseMusic()
const user = require('../../user')
const sdk = new MusicClient()
Expand Down Expand Up @@ -472,10 +473,10 @@ const silentSummary = async (id, ctx) => {
if (ids.length > 0) {
const result = await pify(async).mapLimit(ids, 5, async id => {
if (ctx.query && ctx.query.lyric) {
const ret = await Promise.all([handleSummary(id, ctx.request.origin, true), getLyric(id, true)])
const ret = await Promise.all([handleSummary(id, nconf.get('url'), true), getLyric(id, true)])
return ret
} else {
const ret = await Promise.all([handleSummary(id, ctx.request.origin, true)])
const ret = await Promise.all([handleSummary(id, nconf.get('url'), true)])
return ret
}
})
Expand All @@ -492,9 +493,9 @@ const quickSummary = async (ID, ctx) => {
const ids = ID.split(',')
const result = await pify(async).mapLimit(ids, 5, async id => {
if (ctx.query && ctx.query.lyric) {
return Promise.all([handleSummary(id, ctx.request.origin), getLyric(id)])
return Promise.all([handleSummary(id, nconf.get('url')), getLyric(id)])
} else {
return Promise.all([handleSummary(id, ctx.request.origin)])
return Promise.all([handleSummary(id, nconf.get('url'))])
}
})
return result
Expand Down

0 comments on commit 6a6f4f0

Please sign in to comment.