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"
This commit is contained in:
parent
106a229a27
commit
46f742f82f
1 changed files with 9 additions and 1 deletions
|
@ -141,7 +141,15 @@ class MpdDevice(MediaPlayerDevice):
|
||||||
@property
|
@property
|
||||||
def media_title(self):
|
def media_title(self):
|
||||||
""" Title of current playing media. """
|
""" 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
|
@property
|
||||||
def media_artist(self):
|
def media_artist(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue