mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
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
This commit is contained in:
commit
7e9eaf14b8
@ -141,7 +141,13 @@ 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.get('name', None)
|
||||||
|
title = self.currentsong['title']
|
||||||
|
|
||||||
|
if name is None:
|
||||||
|
return title
|
||||||
|
else:
|
||||||
|
return '{}: {}'.format(name, title)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def media_artist(self):
|
def media_artist(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user