修复导入列表数据时的歌曲信息转换问题
This commit is contained in:
@@ -49,7 +49,7 @@ export const getOtherSource = async(musicInfo: LX.Music.MusicInfo | LX.Download.
|
||||
if (getOtherSourcePromises.has(key)) return getOtherSourcePromises.get(key)
|
||||
|
||||
const promise = musicSdk.findMusic(searchMusicInfo).then((otherSource) => {
|
||||
const sources: LX.Music.MusicInfoOnline[] = otherSource.map(toNewMusicInfo)
|
||||
const sources: LX.Music.MusicInfoOnline[] = otherSource.map(toNewMusicInfo) as LX.Music.MusicInfoOnline[]
|
||||
if (sources.length) void saveOtherSourceFromStore(musicInfo.id, sources)
|
||||
return sources
|
||||
}).finally(() => {
|
||||
|
||||
@@ -53,7 +53,7 @@ export const getListDetail = async(id: string, page: number, isRefresh = false):
|
||||
const [source, bangId] = id.split('__') as [LX.OnlineSource, string]
|
||||
|
||||
return musicSdk[source]?.leaderboard?.getList(bangId, page).then((result: ListDetailInfo) => {
|
||||
result.list = markRawList(deduplicationList(result.list.map(m => toNewMusicInfo(m))))
|
||||
result.list = markRawList(deduplicationList(result.list.map(m => toNewMusicInfo(m)) as LX.Music.MusicInfoOnline[]))
|
||||
cache.set(key, result)
|
||||
return result
|
||||
})
|
||||
@@ -75,7 +75,7 @@ export const getListDetailAll = async(id: string, isRefresh = false): Promise<LX
|
||||
if (!isRefresh && cache.has(key)) return cache.get(key)
|
||||
|
||||
return musicSdk[source]?.leaderboard.getList(id, page).then((result: ListDetailInfo) => {
|
||||
result.list = markRawList(deduplicationList(result.list.map(m => toNewMusicInfo(m))))
|
||||
result.list = markRawList(deduplicationList(result.list.map(m => toNewMusicInfo(m)) as LX.Music.MusicInfoOnline[]))
|
||||
cache.set(key, result)
|
||||
return result
|
||||
}) ?? Promise.reject(new Error('source not found' + source))
|
||||
|
||||
@@ -129,7 +129,7 @@ export const getListDetail = async(id: string, source: LX.OnlineSource, page: nu
|
||||
if (!isRefresh && cache.has(key)) return cache.get(key)
|
||||
|
||||
return musicSdk[source]?.songList.getListDetail(id, page).then((result: ListDetailInfo) => {
|
||||
result.list = markRawList(deduplicationList(result.list.map(m => toNewMusicInfo(m))))
|
||||
result.list = markRawList(deduplicationList(result.list.map(m => toNewMusicInfo(m)) as LX.Music.MusicInfoOnline[]))
|
||||
cache.set(key, result)
|
||||
return result
|
||||
})
|
||||
@@ -151,7 +151,7 @@ export const getListDetailAll = async(id: string, source: LX.OnlineSource, isRef
|
||||
return cache.has(key)
|
||||
? Promise.resolve(cache.get(key))
|
||||
: musicSdk[source]?.songList.getListDetail(id, page).then((result: ListDetailInfo) => {
|
||||
result.list = markRawList(deduplicationList(result.list.map(m => toNewMusicInfo(m))))
|
||||
result.list = markRawList(deduplicationList(result.list.map(m => toNewMusicInfo(m)) as LX.Music.MusicInfoOnline[]))
|
||||
cache.set(key, result)
|
||||
return result
|
||||
}) ?? Promise.reject(new Error('source not found' + source))
|
||||
|
||||
Reference in New Issue
Block a user