Skip to content
Snippets Groups Projects
Commit 46f742f8 authored by Richard Arends's avatar Richard Arends
Browse files

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"
parent 106a229a
No related branches found
No related tags found
No related merge requests found
...@@ -141,7 +141,15 @@ class MpdDevice(MediaPlayerDevice): ...@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment