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
parent
106a229a27
commit
46f742f82f
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue