Esempio n. 1
0
 def do_playlist_tasteprofile(self, line):
     '''
     Create a playlist from echonest taste profile
     Usage: playlist_tasteprofile
         Generate and play a new playlist based on
         echonest taste profile. The current playlist
         is removed before.
     '''
     logger.debug('call function do_playlist_tasteprofile')
     profile_id = get_profile_id(self.api_key)
     while True:
         song_ids = echonest_playlist(self.api_key, profile_id)
         fancy_disp.songs_index(song_ids, self.songs)
         action = fancy_disp.validate_playlist()
         if action <> 'r':
             break
     if action == 'p':
         playback_stop(self.kodi_params)
         kodi_api.playlist_clear(self.kodi_params)
         populate_playlist(song_ids, self.kodi_params) 
         kodi_api.player_open(self.kodi_params)
     print
Esempio n. 2
0
 def do_playlist_tasteprofile(self, line):
     '''
     Create a playlist from echonest taste profile
     Usage: playlist_tasteprofile
         Generate and play a new playlist based on
         echonest taste profile. The current playlist
         is removed before.
     '''
     logger.debug('call function do_playlist_tasteprofile')
     profile_id = get_profile_id(self.api_key)
     while True:
         song_ids = echonest_playlist(self.api_key, profile_id)
         fancy_disp.songs_index(song_ids, self.songs)
         action = fancy_disp.validate_playlist()
         if action <> 'r':
             break
     if action == 'p':
         playback_stop(self.kodi_params)
         kodi_api.playlist_clear(self.kodi_params)
         populate_playlist(song_ids, self.kodi_params)
         kodi_api.player_open(self.kodi_params)
     print
Esempio n. 3
0
 def do_playlist_taste_seed(self, line):
     '''
     Create a playlist from echonest taste profile and seeded by a song
     Usage: playlist_tasteprofile song_id
         Generate and play a new playlist based on
         echonest taste profile. The current playlist
         is removed before.
     '''
     #TODO: function for a single logic and several pl methods
     logger.debug('call function do_playlist_tasteprofile')
     song_id = parse_single_int(line)
     profile_id = get_profile_id(self.api_key)
     while True:
         song_ids = echonest_pl_seed(self.api_key, profile_id, song_id)
         fancy_disp.songs_index(song_ids, self.songs)
         action = fancy_disp.validate_playlist()
         if action <> 'r':
             break
     if action == 'p':
         playback_stop(self.kodi_params)
         kodi_api.playlist_clear(self.kodi_params)
         populate_playlist(song_ids, self.kodi_params) 
         kodi_api.player_open(self.kodi_params)
     print
Esempio n. 4
0
 def do_playlist_taste_seed(self, line):
     '''
     Create a playlist from echonest taste profile and seeded by a song
     Usage: playlist_tasteprofile song_id
         Generate and play a new playlist based on
         echonest taste profile. The current playlist
         is removed before.
     '''
     #TODO: function for a single logic and several pl methods
     logger.debug('call function do_playlist_tasteprofile')
     song_id = parse_single_int(line)
     profile_id = get_profile_id(self.api_key)
     while True:
         song_ids = echonest_pl_seed(self.api_key, profile_id, song_id)
         fancy_disp.songs_index(song_ids, self.songs)
         action = fancy_disp.validate_playlist()
         if action <> 'r':
             break
     if action == 'p':
         playback_stop(self.kodi_params)
         kodi_api.playlist_clear(self.kodi_params)
         populate_playlist(song_ids, self.kodi_params)
         kodi_api.player_open(self.kodi_params)
     print