mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
media_content_type attribute display fix (#13204)
* media_content_type fix Kodi media_content_type attribute display fix * media_content_type fix (#6989) fixes attribute display for unknown media * code cleanup * trailing whitespaces * comments correction * redundant "else:" removed
This commit is contained in:
parent
5c434f143e
commit
92f13ff60d
@ -73,6 +73,8 @@ MEDIA_TYPES = {
|
|||||||
'episode': MEDIA_TYPE_TVSHOW,
|
'episode': MEDIA_TYPE_TVSHOW,
|
||||||
# Type 'channel' is used for radio or tv streams from pvr
|
# Type 'channel' is used for radio or tv streams from pvr
|
||||||
'channel': MEDIA_TYPE_CHANNEL,
|
'channel': MEDIA_TYPE_CHANNEL,
|
||||||
|
# Type 'audio' is used for audio media, that Kodi couldn't scroblle
|
||||||
|
'audio': MEDIA_TYPE_MUSIC,
|
||||||
}
|
}
|
||||||
|
|
||||||
SUPPORT_KODI = SUPPORT_PAUSE | SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE | \
|
SUPPORT_KODI = SUPPORT_PAUSE | SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE | \
|
||||||
@ -480,7 +482,12 @@ class KodiDevice(MediaPlayerDevice):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def media_content_type(self):
|
def media_content_type(self):
|
||||||
"""Content type of current playing media."""
|
"""Content type of current playing media.
|
||||||
|
|
||||||
|
If the media type cannot be detected, the player type is used.
|
||||||
|
"""
|
||||||
|
if MEDIA_TYPES.get(self._item.get('type')) is None and self._players:
|
||||||
|
return MEDIA_TYPES.get(self._players[0]['type'])
|
||||||
return MEDIA_TYPES.get(self._item.get('type'))
|
return MEDIA_TYPES.get(self._item.get('type'))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user