diff --git a/src/renderer/views/Leaderboard/action.ts b/src/renderer/views/Leaderboard/action.ts index 2b0f651a..ca7699a5 100644 --- a/src/renderer/views/Leaderboard/action.ts +++ b/src/renderer/views/Leaderboard/action.ts @@ -5,6 +5,7 @@ import { getListDetail, getListDetailAll } from '@renderer/store/leaderboard/act import { createUserList, setTempList } from '@renderer/store/list/action' import { playList } from '@renderer/core/player/action' import { LIST_IDS } from '@common/constants' +import { toMD5 } from '@renderer/utils' const getListId = (id: string) => `board__${id}` @@ -12,7 +13,7 @@ export const addSongListDetail = async(id: string, name: string, source: LX.Onli // console.log(this.listDetail.info) // if (!this.listDetail.info.name) return const listId = getListId(id) - const targetList = userLists.find(l => l.id == listId) + const targetList = userLists.find(l => l.sourceListId == listId) if (targetList) { const confirm = await dialog.confirm({ message: window.i18n.t('duplicate_list_tip', { name: targetList.name }), @@ -27,7 +28,7 @@ export const addSongListDetail = async(id: string, name: string, source: LX.Onli const list = await getListDetailAll(id) await createUserList({ name, - id: listId, + id: `${source}_${toMD5(listId)}`, list, source, sourceListId: listId, diff --git a/src/renderer/views/songList/Detail/action.ts b/src/renderer/views/songList/Detail/action.ts index b8d95350..5ab4b09c 100644 --- a/src/renderer/views/songList/Detail/action.ts +++ b/src/renderer/views/songList/Detail/action.ts @@ -5,6 +5,7 @@ import { getListDetail, getListDetailAll } from '@renderer/store/songList/action import { createUserList, setTempList } from '@renderer/store/list/action' import { playList } from '@renderer/core/player/action' import { LIST_IDS } from '@common/constants' +import { toMD5 } from '@renderer/utils' const getListId = (id: string, source: LX.OnlineSource) => `${source}__${id}` @@ -12,7 +13,7 @@ export const addSongListDetail = async(id: string, source: LX.OnlineSource, name // console.log(this.listDetail.info) // if (!this.listDetail.info.name) return const listId = getListId(id, source) - const targetList = userLists.find(l => l.id == listId) + const targetList = userLists.find(l => l.sourceListId == listId) if (targetList) { const confirm = await dialog.confirm({ message: window.i18n.t('duplicate_list_tip', { name: targetList.name }), @@ -27,7 +28,7 @@ export const addSongListDetail = async(id: string, source: LX.OnlineSource, name const list = await getListDetailAll(id, source) await createUserList({ name, - id: listId, + id: `${source}_${toMD5(listId)}`, list, source, sourceListId: id,