mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Mpd: Use "file" instead "id" for media_content_id (#4653)
In media_content_id() the "id" of the current song was returned. as stated in bug #4652 the id is only the Tracklist-Id in the current tracklist and is omitted if the track is not part of a tracklist (what caused the bug in the first place). To match the semantics described in the dockstring, to return a "Content ID", this chooses the filename of the current song as id and returns it. It also uses get() instead of [] to prevent KeyError. This fixes bug #4652 Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>
This commit is contained in:
parent
6dfae7a259
commit
dd84b4e237
@ -133,7 +133,7 @@ class MpdDevice(MediaPlayerDevice):
|
||||
@property
|
||||
def media_content_id(self):
|
||||
"""Content ID of current playing media."""
|
||||
return self.currentsong['id']
|
||||
return self.currentsong.get('file')
|
||||
|
||||
@property
|
||||
def media_content_type(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user