Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions homeassistant/components/plex/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@
X_PLEX_PLATFORM = "Home Assistant"
X_PLEX_PRODUCT = "Home Assistant"
X_PLEX_VERSION = __version__

MEDIATYPE_MUSIC = "music"
MEDIATYPE_VIDEO = "video"
Comment thread
jjlawren marked this conversation as resolved.
Outdated
6 changes: 5 additions & 1 deletion homeassistant/components/plex/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
CONF_SERVER_IDENTIFIER,
DISPATCHERS,
DOMAIN as PLEX_DOMAIN,
MEDIATYPE_MUSIC,
MEDIATYPE_VIDEO,
NAME_FORMAT,
PLEX_NEW_MP_SIGNAL,
PLEX_UPDATE_MEDIA_PLAYER_SIGNAL,
Expand Down Expand Up @@ -575,9 +577,11 @@ def play_media(self, media_type, media_id, **kwargs):
shuffle = src.get("shuffle", 0)

media = None
command_mediatype = MEDIATYPE_VIDEO
Comment thread
jjlawren marked this conversation as resolved.
Outdated

if media_type == "MUSIC":
media = self._get_music_media(library, src)
command_mediatype = MEDIATYPE_MUSIC
elif media_type == "EPISODE":
media = self._get_tv_media(library, src)
elif media_type == "PLAYLIST":
Expand All @@ -591,7 +595,7 @@ def play_media(self, media_type, media_id, **kwargs):

playqueue = self.plex_server.create_playqueue(media, shuffle=shuffle)
try:
self.device.playMedia(playqueue)
self.device.playMedia(playqueue, type=command_mediatype)
except ParseError:
# Temporary workaround for Plexamp / plexapi issue
pass
Expand Down