Skip to content

Commit cbdf5ec

Browse files
authored
Fix playMedia() calls with a PlayQueue (#446)
* Fix playMedia() calls with a PlayQueue * Fix playlists, simplify
1 parent dd91ae4 commit cbdf5ec

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

plexapi/client.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,10 +475,15 @@ def playMedia(self, media, offset=0, **params):
475475

476476
if hasattr(media, "playlistType"):
477477
mediatype = media.playlistType
478-
elif media.listType == "audio":
479-
mediatype = "music"
480478
else:
481-
mediatype = "video"
479+
if isinstance(media, PlayQueue):
480+
mediatype = media.items[0].listType
481+
else:
482+
mediatype = media.listType
483+
484+
# mediatype must be in ["video", "music", "photo"]
485+
if mediatype == "audio":
486+
mediatype = "music"
482487

483488
if self.product != 'OpenPHT':
484489
try:

0 commit comments

Comments
 (0)