Merge pull request #740 from Mosibi/mpd_show_name_and_title

Added support for MPD to display the name before the title if it is available
pull/717/merge
Paulus Schoutsen 2015-12-13 11:52:54 -08:00
commit 7e9eaf14b8
1 changed files with 7 additions and 1 deletions

View File

@ -141,7 +141,13 @@ class MpdDevice(MediaPlayerDevice):
@property
def media_title(self):
""" Title of current playing media. """
return self.currentsong['title']
name = self.currentsong.get('name', None)
title = self.currentsong['title']
if name is None:
return title
else:
return '{}: {}'.format(name, title)
@property
def media_artist(self):