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

def AmpacheTools::AmpacheGUI::AmpacheGUI::__add_songs_to_list_store (   self,
  album_id 
) [private]
Takes an album_id, and adds all of that albums songs to the GUI.

Definition at line 3280 of file AmpacheGUI.py.

                                                   :
            """Takes an album_id, and adds all of that albums songs to the GUI."""
            self.check_and_populate_songs(album_id)
            songs = dbfunctions.get_song_dict(self.db_session, album_id)
            model = self.song_list_store
            
            if not songs:
                  print "Error pulling ", album_id
                  self.update_statusbar(_("Error with album -- Check Ampache -- Album ID = %d" % album_id))
                  return False
            
            for song in songs:
                  song_track  = songs[song]['track']
                  song_title  = songs[song]['title']
                  song_time   = songs[song]['time']
                  song_size   = songs[song]['size']
                  song_id     = song
                  artist_name = songs[song]['artist_name']
                  album_name  = songs[song]['album_name']
                  #album_year  = self.ampache_conn.get_album_year(album_id)S

                  # convert time in seconds to HH:MM:SS THIS WILL FAIL IF LENGTH > 24 HOURS
                  song_time = time.strftime('%H:%M:%S', time.gmtime(song_time))
                  if song_time[:2] == "00": # strip out hours if below 60 minutes
                        song_time = song_time[3:]
                  # convert size to humand_readable
                  song_size = helperfunctions.convert_filesize_to_human_readable(float(song_size))
                  
                  model.append([song_track, song_title, artist_name, album_name, song_time, song_size, song_id])
            return True


Generated by  Doxygen 1.6.0   Back to index