@@ -7,9 +7,9 @@ interface PlayerStore {
7
7
* state
8
8
*/
9
9
paused : boolean ;
10
- currentSong : string ;
11
- currentSongDataURL : string ;
12
- currentSongMetadata : LightweightAudioMetadata ;
10
+ currentSong : string ; // holds the path of the current song
11
+ currentSongArtworkDataURL : string ; // holds the artwork of the current song
12
+ currentSongMetadata : LightweightAudioMetadata ; // holds the metadata of the current song
13
13
shuffle : boolean ;
14
14
repeating : boolean ;
15
15
volume : number ;
@@ -26,7 +26,7 @@ interface PlayerStore {
26
26
setPaused : ( paused : boolean ) => void ;
27
27
setShuffle : ( shuffle : boolean ) => void ;
28
28
setRepeating : ( repeating : boolean ) => void ;
29
- setCurrentSongWithDetails : (
29
+ setCurrentSong : (
30
30
songPath : string ,
31
31
library ?: { [ key : string ] : LightweightAudioMetadata } ,
32
32
) => void ;
@@ -44,7 +44,7 @@ const usePlayerStore = create<PlayerStore>((set) => ({
44
44
*/
45
45
paused : true ,
46
46
currentSong : '' ,
47
- currentSongDataURL : '' ,
47
+ currentSongArtworkDataURL : '' ,
48
48
currentSongMetadata : { } as LightweightAudioMetadata ,
49
49
shuffle : false ,
50
50
repeating : false ,
@@ -73,7 +73,7 @@ const usePlayerStore = create<PlayerStore>((set) => ({
73
73
// @note : when shuffle is toggled on or off we clear the shuffle history
74
74
setShuffle : ( shuffle ) => set ( { shuffle, shuffleHistory : [ ] } ) ,
75
75
setRepeating : ( repeating ) => set ( { repeating } ) ,
76
- setCurrentSongWithDetails : ( songPath : string , library ) => {
76
+ setCurrentSong : ( songPath : string , library ) => {
77
77
if ( ! library ) {
78
78
// eslint-disable-next-line no-console
79
79
console . error ( 'No library provided to setCurrentSongWithDetails' ) ;
@@ -110,7 +110,7 @@ const usePlayerStore = create<PlayerStore>((set) => ({
110
110
url = await bufferToDataUrl ( event . data , event . format ) ;
111
111
}
112
112
113
- set ( { currentSongDataURL : url } ) ;
113
+ set ( { currentSongArtworkDataURL : url } ) ;
114
114
115
115
if ( navigator . mediaSession . metadata ?. artwork ) {
116
116
navigator . mediaSession . metadata . artwork = [
0 commit comments