~ubuntu-branches/ubuntu/lucid/awn-extras-applets/lucid

« back to all changes in this revision

Viewing changes to shared/python/awnmediaplayers.py

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2010-03-30 20:26:40 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100330202640-vza3bdnv9gc9bg5z
Tags: 0.4.0~rc1-0ubuntu1
* New upstream release (rc1) (LP: #551309)
 - Stack applet close on click (LP: #261520)
* debian/patches/
 - 03-remove-cairo-menu-pref.patch: From upstream (r1244 + r1245 + r1252),
   remove menu entry for cairo-menu preferences, it's not implemented
   (LP: #511254)
 - 04-tomboy-threading-free.patch: From upstream (r1246), remove threading to
   make the applet working. 
* debian/*.install: Update installation location of comics and digital 
  applets.
* debian/control: 
 - Move digital applet from python to C, and add proper Replaces.
 - Add Replaces for awn-applets-c-core to handle migration from 0.3.2.2.
   (LP: #524559)

Show diffs side-by-side

added added

removed removed

Lines of Context:
288
288
        ret_dict = {}
289
289
        result = self.rbShell.getSongProperties(self.player.getPlayingUri())
290
290
 
 
291
        # Currently Playing Title
 
292
        if result['artist'] != '':
 
293
            ret_dict['artist'] = result['artist']
 
294
            ret_dict['title'] = result['title']
 
295
            if 'album' in result: ret_dict['album'] = result['album']
 
296
        elif 'rb:stream-song-title' in result:
 
297
            if result['title'] != '':
 
298
                ret_dict['title'] = result['rb:stream-song-title'] + ' (' + result['title'] + ')'
 
299
            else:
 
300
               ret_dict['title'] = result['rb:stream-song-title']
 
301
        elif 'title' in result:
 
302
            ret_dict['title'] = result['title']
 
303
 
 
304
        # cover-art
291
305
        if 'rb:coverArt-uri' in result:
292
306
            albumart_exact = result['rb:coverArt-uri']
293
307
            # bug in rhythmbox 0.11.6 - returns uri, but not properly encoded,
297
311
                from urllib import unquote
298
312
                albumart_exact = unquote(albumart_exact)
299
313
            ret_dict['album-art'] = albumart_exact
300
 
 
301
 
        # Currently Playing Title
302
 
        if result['artist'] != '':
303
 
            ret_dict['artist'] = result['artist']
304
 
            ret_dict['title'] = result['title']
305
 
            if 'album' in result: ret_dict['album'] = result['album']
306
 
        elif 'rb:stream-song-title' in result:
307
 
            if result['title'] != '':
308
 
                ret_dict['title'] = result['rb:stream-song-title'] + ' (' + result['title'] + ')'
309
 
            else:
310
 
               ret_dict['title'] = result['rb:stream-song-title']
311
 
        elif 'title' in result:
312
 
            ret_dict['title'] = result['title']
 
314
        else:
 
315
            # perhaps it's in the cache folder
 
316
            if 'album' in result and 'artist' in result:
 
317
                cache_dir = ".cache/rhythmbox/covers"
 
318
                ret_dict['album-art'] = '%s/%s - %s.jpg' % (cache_dir, result['artist'], result['album'])
313
319
 
314
320
        return ret_dict
315
321