fix: search results use pic/mPic/sPic/qualities (QZv2 format) instead of img/types/_types
This commit is contained in:
@@ -73,22 +73,23 @@ function handleSearchResult(rawList) {
|
||||
var list = [];
|
||||
for (var i = 0; i < rawList.length; i++) {
|
||||
var item = rawList[i];
|
||||
var types = [];
|
||||
var _types = {};
|
||||
types.push({ type: '128k', size: '' }); _types['128k'] = { size: '' };
|
||||
types.push({ type: '320k', size: '' }); _types['320k'] = { size: '' };
|
||||
var qualities = {};
|
||||
if (item.filesize) qualities.standard = String(item.filesize);
|
||||
if (item.sqfilesize) qualities.exhigh = String(item.sqfilesize);
|
||||
if (item.flacfilesize) qualities.lossless = String(item.flacfilesize);
|
||||
var picUrl = item.pic || '';
|
||||
list.push({
|
||||
artists: item.artist || '',
|
||||
id: item.id || item.rid || '',
|
||||
name: item.name || '',
|
||||
artists: item.artist || '',
|
||||
source: 'kw',
|
||||
pic: picUrl,
|
||||
mPic: picUrl,
|
||||
sPic: picUrl,
|
||||
albumName: item.album || '',
|
||||
albumId: item.albumid || '',
|
||||
source: 'kw',
|
||||
interval: item.duration ? formatPlayTime(item.duration) : '',
|
||||
id: item.id || item.rid || '',
|
||||
songId: item.id || item.rid || '',
|
||||
img: item.pic || '',
|
||||
lrc: null,
|
||||
types: types, _types: _types, typeUrl: {}
|
||||
qualities: qualities
|
||||
});
|
||||
}
|
||||
return list;
|
||||
@@ -122,7 +123,7 @@ function getUrl(songInfo, type) {
|
||||
|
||||
// ===== 封面图 =====
|
||||
function getPic(songInfo) {
|
||||
if (songInfo.img) return Promise.resolve(songInfo.img);
|
||||
if (songInfo.pic) return Promise.resolve(songInfo.pic);
|
||||
return Promise.resolve('');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user