def _updateText(self):
     if not self._playing and mpdlibrary.isStream(self.song):
         title = mpdlibrary.songStation(self.song)
         artist = ''
     else:
         artist = mpdlibrary.songArtist(self.song)
         title = mpdlibrary.songTitle(self.song)
     if self.oneLine:
         self.setText(artist + ' - ' + title)
     else:
         self.setText(title + '\n' + artist)
     if mpdlibrary.isStream(self.song):
         self.setToolTip("Station:\t %s\nurl:\t %s" % (mpdlibrary.songStation(self.song), self.song['file']))
     else:
         self.setToolTip("Album:\t %s\nTime:\t %s\nFile:\t %s" % (mpdlibrary.songAlbum(self.song), str(mpdlibrary.songTime(self.song)) , self.song['file']))
 def _updateText(self):
     if not self._playing and mpdlibrary.isStream(self.song):
         title = mpdlibrary.songStation(self.song)
         artist = ''
     else:
         artist = mpdlibrary.songArtist(self.song)
         title = mpdlibrary.songTitle(self.song)
     if self.oneLine:
         self.setText(artist + ' - ' + title)
     else:
         self.setText(title + '\n' + artist)
     if mpdlibrary.isStream(self.song):
         self.setToolTip(
             "Station:\t %s\nurl:\t %s" %
             (mpdlibrary.songStation(self.song), self.song['file']))
     else:
         self.setToolTip(
             "Album:\t %s\nTime:\t %s\nFile:\t %s" %
             (mpdlibrary.songAlbum(self.song),
              str(mpdlibrary.songTime(self.song)), self.song['file']))
Esempio n. 3
0
 def songIcon(self, song):
     '''Try to get a cover image from folder.jpg, if that fails. Get an album
     cover from the interwebs. If it can't find an album cover it tries to get
     a picture of the artist.'''
     # comment out the next line to disable icon fetching.
     #return NOCOVER
     if mpdlibrary.isStream(song):
         return STREAMICON
     cover = None
     cover = self.getFolderImage(song)
     if not cover:
         #print 'debug: no folder.jpg'
         if not self.coverPath:
             return NOCOVER
         try:
             artist = mpdlibrary.songArtist(song)
             album = mpdlibrary.songAlbum(song)
             if artist:
                 if album:
                     cover = self.getAlbumImage(artist,album)
                 if not cover:
                     cover = self.getArtistImage(artist)
         except Exception, e:
             print 'error: in iconretriever', e