MCPcopy Create free account
hub / github.com/dinofizz/diskplayer / activePlayerId

Function activePlayerId

diskplayer.go:106–114  ·  view source on GitHub ↗

activePlayerIds iterates through the provided player devices and returns the active ID. If there is no active Spotify client device the ID will be returned as a nil pointer.

(ds *[]spotify.PlayerDevice)

Source from the content-addressed store, hash-verified

104// activePlayerIds iterates through the provided player devices and returns the active ID. If there is no active
105// Spotify client device the ID will be returned as a nil pointer.
106func activePlayerId(ds *[]spotify.PlayerDevice) spotify.ID {
107 for _, d := range *ds {
108 if d.Active {
109 return d.ID
110 }
111 }
112
113 return ""
114}
115
116// diskplayerId returns the Spotify ID for the Spotify client whose name is provided in the parameter list,
117// or a nil pointer if no matching device is found.

Callers 2

PlayUriFunction · 0.85
PauseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected