fix: 统一单个哈希查询的响应处理逻辑

This commit is contained in:
lixiangwuxian 2025-03-08 21:18:10 +08:00
parent b22185e87f
commit a2d17709ed
2 changed files with 6 additions and 0 deletions

View File

@ -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)

View File

@ -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)