@@ -3,7 +3,7 @@ import useStore from "@/store";
33import usePlayAudio from "@/hooks/usePlayAudio" ;
44import MiniPlayer from "@/components/MiniPlayer" ;
55import { parseMusicMeta } from "@/utils/meta" ;
6- import { updatePlaylist } from "@/utils/player" ;
6+ import { updatePlayQuque } from "@/utils/player" ;
77
88const Player = ( ) => {
99 const currentMusicId = useStore ( ( state ) => state . currentMusicId ) ;
@@ -12,7 +12,7 @@ const Player = () => {
1212 const musicMetaMap = useStore . getState ( ) . musicMetaMap ;
1313 const musicList = useStore ( ( state ) => state . getMusicList ( ) ) ;
1414 const history = useStore ( ( state ) => state . history ) ;
15- const playlist = useStore ( ( state ) => state . playlist ) ;
15+ const playQueue = useStore ( ( state ) => state . playQueue ) ;
1616 const isShuffle = useStore ( ( state ) => state . isShuffle ) ;
1717 const isRepeat = useStore ( ( state ) => state . isRepeat ) ;
1818 const isLoop = useStore ( ( state ) => state . isLoop ) ;
@@ -48,23 +48,23 @@ const Player = () => {
4848 } , [ currentMusicId , currentFileName ] ) ;
4949
5050 useEffect ( ( ) => {
51- updatePlaylist ( ) ;
51+ updatePlayQuque ( ) ;
5252 } , [ isShuffle , isLoop ] ) ;
5353
5454 const next = ( isEnded ?: boolean ) => {
5555 if ( useStore . getState ( ) . isRepeat && isEnded ) {
5656 return controls . reload ( ) ;
5757 }
5858
59- const playlist = useStore . getState ( ) . playlist ;
59+ const playQueue = useStore . getState ( ) . playQueue ;
6060
61- if ( playlist . length === 0 ) return ;
61+ if ( playQueue . length === 0 ) return ;
6262
63- const musicIndex = playlist [ 0 ] ;
63+ const musicIndex = playQueue [ 0 ] ;
6464 const music = useStore . getState ( ) . getMusicList ( ) [ musicIndex ] ;
6565
6666 setCurrentMusic ( music . sign , musicIndex , music . name ) ;
67- updatePlaylist ( "next" ) ;
67+ updatePlayQuque ( "next" ) ;
6868 } ;
6969
7070 const prev = ( ) => {
@@ -106,7 +106,7 @@ const Player = () => {
106106 artist,
107107 cover : coverUrl ,
108108 prevDisabled : history . length === 0 ,
109- nextDisabled : playlist . length === 0 ,
109+ nextDisabled : playQueue . length === 0 ,
110110 next,
111111 prev,
112112 isLoop,
0 commit comments