Logo Search packages:      
Sourcecode: viridian version File versions  Download package

def AmpacheTools::AmpacheGUI::AmpacheGUI::update_playlist_select (   self,
  type,
  playlist_list_store 
)
Refresh the contents of the playlist list store

Definition at line 1578 of file AmpacheGUI.py.

                                                                 :
            """Refresh the contents of the playlist list store"""
            playlist_list_store.clear()
            if type == "Load": # load playlists window
                  # get playlists from Ampache
                  ampache_playlists = self.ampache_conn.get_playlists()
                  if ampache_playlists == None:
                        ampache_playlists = []
                  print ampache_playlists
                  playlist_list_store.append(['<b> - Ampache Playlists - </b>', len(ampache_playlists), '----', '----', -1])
                  if len(ampache_playlists) == 0:
                        playlist_list_store.append(['<i>-(None)-</i>', 0, '', '', -1])
                  else:
                        for playlist in ampache_playlists:
                              playlist_list_store.append([ helperfunctions.convert_string_to_html(playlist['name']), playlist['items'], playlist['owner'], playlist['type'], playlist['id']])
                  # get playlists stored locally
            local_playlists = dbfunctions.get_playlists(self.db_session)
            playlist_list_store.append(['<b> - Local Playlists - </b>', len(local_playlists), '----', '----', -1])
            if len(local_playlists) == 0:
                  playlist_list_store.append(['<i>-(None)-</i>', 0, '', '', -1])
            else:
                  for playlist in local_playlists:
                        playlist_list_store.append([ helperfunctions.convert_string_to_html(playlist['name']), len(playlist['songs']), getpass.getuser(), 'Local', -2]) 
      
            

Generated by  Doxygen 1.6.0   Back to index