diff --git a/packages/admin/pages/playlist.vue b/packages/admin/pages/playlist.vue index 247309f..47f04a5 100644 --- a/packages/admin/pages/playlist.vue +++ b/packages/admin/pages/playlist.vue @@ -137,13 +137,12 @@ async function viewPlaylistDataUpdate () { // Sort by song name or artist in alphabetical order if (viewPlaylistSortingColumn.value === 'name' || viewPlaylistSortingColumn.value === 'artist') { const pinyinPro = await import('pinyin-pro') - playlist.map((song) => { + playlist.forEach((song, index) => { // @ts-ignore - song[`${viewPlaylistSortingColumn.value}Pinyin`] = + playlist[index][`${viewPlaylistSortingColumn.value}Pinyin`] = // @ts-ignore pinyinPro.pinyin(song[viewPlaylistSortingColumn.value], { toneType: 'none', nonZh: 'consecutive' }) .replaceAll(' ', '') - return song }) playlist.sort((a, b) => { // @ts-ignore diff --git a/packages/home/app.vue b/packages/home/app.vue index 2937513..f410e1a 100644 --- a/packages/home/app.vue +++ b/packages/home/app.vue @@ -383,13 +383,12 @@ function viewPlaylistDataUpdate (tasks: Array<'shuffle' | 'sort'>) { // Sort by song name or artist in alphabetical order if (viewPlaylistSortingColumn.value === 'name' || viewPlaylistSortingColumn.value === 'artist') { const pinyinPro = await import('pinyin-pro') - playlist.map((song) => { + playlist.forEach((song, index) => { // @ts-ignore - song[`${viewPlaylistSortingColumn.value}Pinyin`] = + playlist[index][`${viewPlaylistSortingColumn.value}Pinyin`] = // @ts-ignore pinyinPro.pinyin(song[viewPlaylistSortingColumn.value], { toneType: 'none', nonZh: 'consecutive' }) .replaceAll(' ', '') - return song }) playlist.sort((a, b) => { // @ts-ignore