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)
| 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. |
| 106 | func 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. |