MCPcopy Create free account
hub / github.com/jasperproject/jasper-client / play

Method play

client/modules/MPDControl.py:259–279  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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):

Callers 2

delegateInputMethod · 0.45
handleForeverMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected