def do_play_christmas(self, line): """Play seasonal Christmas songs""" logger.debug('call function do_play_christmas') profile_id = pk.en_profile_id(self.params['echonest_key']) songids = pk.en_playlist_seed_song_type(self.params['echonest_key'], profile_id, 'christmas') pk.playback_stop(self.params) pk.playlist_clear(self.params) pk.playlist_add_songs(self.params, songids) pk.playback_start(self.params)
def do_playlist_add_songs(self, line): """ Add a song to the playlist Usage: playlist_add_songs id Add the song id to the current playlist. Use the songs function to find the id. """ logger.debug('call function do_playlist_add_song') songids = [] songids.append(int(line)) pk.playlist_add_songs(self.params, songids)
def do_play_songs(self, line): """ Play a given song Usage: play_songs id """ logger.debug('call function do_play_songs') songids = [] songids.append(int(line)) pk.playback_stop(self.params) pk.playlist_clear(self.params) pk.playlist_add_songs(self.params, songids) pk.playback_start(self.params)
def do_playlist_tasteprofile(self, line): """ Create a playlist from echonest taste profile Usage: playlist_tasteprofile Generate a new playlist based on echonest taste profile. The current playlist is removed before. """ logger.debug('call function do_playlist_tasteprofile') profile_id = pk.en_profile_id(self.params['echonest_key']) songids = pk.en_playlist(self.params['echonest_key'], profile_id) pk.playlist_clear(self.params) pk.playlist_add_songs(self.params, songids) pkd.songs_index(songids, self.songs) print
def do_playlist_taste_seed_type(self, line): """ Create a playlist from echonest taste profile seeded by a song type Usage: playlist_taste_seed christmas|live|studio Generate a new playlist based on your echonest taste, profile seeded by a song type. The current playlist is removed before. """ logger.debug('call function do_playlist_taste_seed_type') song_type = line profile_id = pk.en_profile_id(self.params['echonest_key']) songids = pk.en_playlist_seed_song_type(self.params['echonest_key'], profile_id, song_type) pk.playlist_clear(self.params) pk.playlist_add_songs(self.params, songids) pkd.songs_index(songids, self.songs) print