fix: 统一单个哈希查询的响应处理逻辑
This commit is contained in:
parent
b22185e87f
commit
a2d17709ed
@ -402,6 +402,9 @@ func GetSongIdsByHash(hashs []string) (hashToSongId map[string]string, err error
|
||||
ID string `json:"id"`
|
||||
}
|
||||
err = json.Unmarshal(body, &singleResponse)
|
||||
response = make(map[string]struct {
|
||||
ID string `json:"id"`
|
||||
})
|
||||
response[batchHashs[0]] = singleResponse
|
||||
} else {
|
||||
err = json.Unmarshal(body, &response)
|
||||
|
@ -430,6 +430,9 @@ func GetSongIdsByHash(hashs []string) (hashToSongId map[string]string, err error
|
||||
ID string `json:"id"`
|
||||
}
|
||||
err = json.Unmarshal(body, &singleResponse)
|
||||
response = make(map[string]struct {
|
||||
ID string `json:"id"`
|
||||
})
|
||||
response[batchHashs[0]] = singleResponse
|
||||
} else {
|
||||
err = json.Unmarshal(body, &response)
|
||||
|
Loading…
x
Reference in New Issue
Block a user