Skip to content
Snippets Groups Projects
Commit 92f13ff6 authored by Eugene Kuzin's avatar Eugene Kuzin Committed by Adam Mills
Browse files

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
parent 5c434f14
Branches
Tags
No related merge requests found
......@@ -73,6 +73,8 @@ MEDIA_TYPES = {
'episode': MEDIA_TYPE_TVSHOW,
# Type 'channel' is used for radio or tv streams from pvr
'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 | \
......@@ -480,7 +482,12 @@ class KodiDevice(MediaPlayerDevice):
@property
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'))
@property
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment