Temporary Plex play_media workaround (#33542)

* Temporary playMedia() workaround on plexapi 3.3.0

* Use constants for strings

* Style cleanup
This commit is contained in:
jjlawren 2020-04-02 18:47:58 -05:00 committed by GitHub
parent 3df46cd70a
commit 55870aec31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,7 @@ from homeassistant.components.media_player.const import (
MEDIA_TYPE_MOVIE,
MEDIA_TYPE_MUSIC,
MEDIA_TYPE_TVSHOW,
MEDIA_TYPE_VIDEO,
SUPPORT_NEXT_TRACK,
SUPPORT_PAUSE,
SUPPORT_PLAY,
@ -575,9 +576,11 @@ class PlexMediaPlayer(MediaPlayerDevice):
shuffle = src.get("shuffle", 0)
media = None
command_media_type = MEDIA_TYPE_VIDEO
if media_type == "MUSIC":
media = self._get_music_media(library, src)
command_media_type = MEDIA_TYPE_MUSIC
elif media_type == "EPISODE":
media = self._get_tv_media(library, src)
elif media_type == "PLAYLIST":
@ -591,7 +594,7 @@ class PlexMediaPlayer(MediaPlayerDevice):
playqueue = self.plex_server.create_playqueue(media, shuffle=shuffle)
try:
self.device.playMedia(playqueue)
self.device.playMedia(playqueue, type=command_media_type)
except ParseError:
# Temporary workaround for Plexamp / plexapi issue
pass