Plays the current song or accepts a song to play. Arguments: songs -- a list of song objects playlist_name -- user-defined, something like "Love Song Playlist"
(self, songs=False, playlist_name=False)
| 257 | |
| 258 | @reconnect |
| 259 | def play(self, songs=False, playlist_name=False): |
| 260 | """ |
| 261 | Plays the current song or accepts a song to play. |
| 262 | |
| 263 | Arguments: |
| 264 | songs -- a list of song objects |
| 265 | playlist_name -- user-defined, something like "Love Song Playlist" |
| 266 | """ |
| 267 | if songs: |
| 268 | self.client.clear() |
| 269 | for song in songs: |
| 270 | try: # for some reason, certain ids don't work |
| 271 | self.client.add(song.id) |
| 272 | except: |
| 273 | pass |
| 274 | |
| 275 | if playlist_name: |
| 276 | self.client.clear() |
| 277 | self.client.load(playlist_name) |
| 278 | |
| 279 | self.client.play() |
| 280 | |
| 281 | @reconnect |
| 282 | def current_song(self): |
no outgoing calls
no test coverage detected