Added support for MPD to display the name before the title if it is available

When using a radio stream, the name of the station is often available in
currentsong['name']. Just like the 'mpc' CLI client, this change displays
the name of the station before the current song title.

For example: "Mick Jagger - Let's Work" becomes "Radio 10: Mick Jagger - Let's Work"
pull/740/head
Richard Arends 2015-12-13 18:42:53 +01:00
parent 106a229a27
commit 46f742f82f
1 changed files with 9 additions and 1 deletions

View File

@ -141,7 +141,15 @@ class MpdDevice(MediaPlayerDevice):
@property
def media_title(self):
""" Title of current playing media. """
return self.currentsong['title']
name = self.currentsong['name']
title = self.currentsong['title']
if name:
separator = ': '
nameandtitle = (name, title)
return separator.join(nameandtitle)
else:
return title
@property
def media_artist(self):