File tree Expand file tree Collapse file tree 1 file changed +37
-35
lines changed Expand file tree Collapse file tree 1 file changed +37
-35
lines changed Original file line number Diff line number Diff line change @@ -56,43 +56,45 @@ class WebSocketTransport {
56
56
neptune . store . getState ( ) . playbackControls . playbackState ==
57
57
"NOT_PLAYING" ;
58
58
59
- ws . send (
60
- JSON . stringify ( {
61
- cmd : "SET_ACTIVITY" ,
62
- args : {
63
- pid : 2094112 ,
64
- activity : {
65
- timestamps : {
66
- ...( paused
67
- ? { }
68
- : {
69
- start : now ,
70
- end : remaining ,
71
- } ) ,
72
- } ,
73
- type : 2 ,
74
- name : formatLongString ( currentlyPlaying . title ) ,
75
- details : formatLongString (
76
- "by " + currentlyPlaying . artists . map ( ( a ) => a . name ) . join ( ", " )
77
- ) ,
78
- assets : {
79
- large_image : `https://resources.tidal.com/images/${ currentlyPlaying . album . cover
80
- . split ( "-" )
81
- . join ( "/" ) } /80x80.jpg`,
82
- large_text : `on ${ formatLongString (
83
- currentlyPlaying . album . title
84
- ) } `,
85
- ...( paused
86
- ? {
87
- small_image : "paused-icon" ,
88
- small_text : "Paused" ,
89
- }
90
- : { } ) ,
59
+ this . ws . readyState == 1 &&
60
+ ws . send (
61
+ JSON . stringify ( {
62
+ cmd : "SET_ACTIVITY" ,
63
+ args : {
64
+ pid : 2094112 ,
65
+ activity : {
66
+ timestamps : {
67
+ ...( paused
68
+ ? { }
69
+ : {
70
+ start : now ,
71
+ end : remaining ,
72
+ } ) ,
73
+ } ,
74
+ type : 2 ,
75
+ name : formatLongString ( currentlyPlaying . title ) ,
76
+ details : formatLongString (
77
+ "by " +
78
+ currentlyPlaying . artists . map ( ( a ) => a . name ) . join ( ", " )
79
+ ) ,
80
+ assets : {
81
+ large_image : `https://resources.tidal.com/images/${ currentlyPlaying . album . cover
82
+ . split ( "-" )
83
+ . join ( "/" ) } /80x80.jpg`,
84
+ large_text : `on ${ formatLongString (
85
+ currentlyPlaying . album . title
86
+ ) } `,
87
+ ...( paused
88
+ ? {
89
+ small_image : "paused-icon" ,
90
+ small_text : "Paused" ,
91
+ }
92
+ : { } ) ,
93
+ } ,
91
94
} ,
92
95
} ,
93
- } ,
94
- } )
95
- ) ;
96
+ } )
97
+ ) ;
96
98
} )
97
99
) ;
98
100
}
You can’t perform that action at this time.
0 commit comments