Skip to content

Commit

Permalink
Merge pull request #85 from lovegaoshi/dev-noxplayer
Browse files Browse the repository at this point in the history
fix: shuffle all
  • Loading branch information
lovegaoshi authored Jun 5, 2024
2 parents 6e3bae6 + 02f3652 commit f5506c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

一切因为使用电闹播放器导致您账号被风控封禁的问题,电闹播放器恕不负责。

4.0.1:
4.0.2:
github同步
歌词性能提升
省内存的处理模式
Expand Down
8 changes: 6 additions & 2 deletions src/components/Playlists/PlaylistsHeader/ShuffleAllButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ interface Props {
}
function ShuffleAll({ sx }: Props) {
const playlists = useNoxSetting((state) => state.playlists);
const getPlaylist = useNoxSetting((state) => state.getPlaylist);
const { loadToSearchListAndPlay } = usePlayback();

const shuffleAll = () => {
const allSongs = Object.values(playlists).reduce(
const shuffleAll = async () => {
const allPlaylists = await Promise.all(
Object.values(playlists).map((p) => getPlaylist(p.id)),
);
const allSongs = Object.values(allPlaylists).reduce(
(acc, curr) => acc.concat(curr.songList),
[] as NoxMedia.Song[],
);
Expand Down

0 comments on commit f5506c5

Please sign in to comment.