mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
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:
parent
3df46cd70a
commit
55870aec31
@ -11,6 +11,7 @@ from homeassistant.components.media_player.const import (
|
|||||||
MEDIA_TYPE_MOVIE,
|
MEDIA_TYPE_MOVIE,
|
||||||
MEDIA_TYPE_MUSIC,
|
MEDIA_TYPE_MUSIC,
|
||||||
MEDIA_TYPE_TVSHOW,
|
MEDIA_TYPE_TVSHOW,
|
||||||
|
MEDIA_TYPE_VIDEO,
|
||||||
SUPPORT_NEXT_TRACK,
|
SUPPORT_NEXT_TRACK,
|
||||||
SUPPORT_PAUSE,
|
SUPPORT_PAUSE,
|
||||||
SUPPORT_PLAY,
|
SUPPORT_PLAY,
|
||||||
@ -575,9 +576,11 @@ class PlexMediaPlayer(MediaPlayerDevice):
|
|||||||
shuffle = src.get("shuffle", 0)
|
shuffle = src.get("shuffle", 0)
|
||||||
|
|
||||||
media = None
|
media = None
|
||||||
|
command_media_type = MEDIA_TYPE_VIDEO
|
||||||
|
|
||||||
if media_type == "MUSIC":
|
if media_type == "MUSIC":
|
||||||
media = self._get_music_media(library, src)
|
media = self._get_music_media(library, src)
|
||||||
|
command_media_type = MEDIA_TYPE_MUSIC
|
||||||
elif media_type == "EPISODE":
|
elif media_type == "EPISODE":
|
||||||
media = self._get_tv_media(library, src)
|
media = self._get_tv_media(library, src)
|
||||||
elif media_type == "PLAYLIST":
|
elif media_type == "PLAYLIST":
|
||||||
@ -591,7 +594,7 @@ class PlexMediaPlayer(MediaPlayerDevice):
|
|||||||
|
|
||||||
playqueue = self.plex_server.create_playqueue(media, shuffle=shuffle)
|
playqueue = self.plex_server.create_playqueue(media, shuffle=shuffle)
|
||||||
try:
|
try:
|
||||||
self.device.playMedia(playqueue)
|
self.device.playMedia(playqueue, type=command_media_type)
|
||||||
except ParseError:
|
except ParseError:
|
||||||
# Temporary workaround for Plexamp / plexapi issue
|
# Temporary workaround for Plexamp / plexapi issue
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user