File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -90,8 +90,8 @@ export function GetFeedbacksList(getState: () => SpotifyState): CompanionFeedbac
90
90
91
91
[ FeedbackId . CurrentContext ] : {
92
92
type : 'boolean' ,
93
- name : 'Change button style if current album/artist/playlist id matches value' ,
94
- description : 'If active album/artist/playlist matches value, change button color' ,
93
+ name : 'Change button style if current album/artist/playlist/track id matches value' ,
94
+ description : 'If active album/artist/playlist/track matches value, change button color' ,
95
95
options : [
96
96
{
97
97
type : 'textinput' ,
Original file line number Diff line number Diff line change @@ -379,6 +379,13 @@ class SpotifyInstance extends InstanceBase<DeviceConfig> implements SpotifyInsta
379
379
deviceInfo : null ,
380
380
}
381
381
382
+ // If an individual track is playing then context is null from Spotify API
383
+ // If the current context is null, but a track is playing, then set the context to the track uri
384
+ // This allows feedbacks to be triggered when an track is playing
385
+ if ( newState . currentContext === null && data . body . currently_playing_type === 'track' && data . body . item ) {
386
+ newState . currentContext = data . body . item . uri . split ( ':' ) [ 2 ]
387
+ }
388
+
382
389
if ( data . body . item ) {
383
390
newState . trackInfo = {
384
391
durationMs : data . body . item . duration_ms ,
You can’t perform that action at this time.
0 commit comments