From 52e608cc438fb7bb826bb540d9fa95d963d46aa1 Mon Sep 17 00:00:00 2001 From: samwiseg0 Date: Thu, 19 Sep 2019 22:29:44 -0400 Subject: [PATCH] Fix blank audio on activity card when changing audio streams --- plexpy/pmsconnect.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plexpy/pmsconnect.py b/plexpy/pmsconnect.py index 68445627..74fdc6b5 100644 --- a/plexpy/pmsconnect.py +++ b/plexpy/pmsconnect.py @@ -1644,13 +1644,16 @@ class PmsConnect(object): video_stream_info = audio_stream_info = subtitle_stream_info = None for stream in stream_media_parts_info.getElementsByTagName('Stream'): if helpers.get_xml_attr(stream, 'streamType') == '1': - video_stream_info = stream + if video_stream_info is None or helpers.get_xml_attr(stream, 'selected') == '1': + video_stream_info = stream - elif helpers.get_xml_attr(stream, 'streamType') == '2' and helpers.get_xml_attr(stream, 'selected') == '1': - audio_stream_info = stream + elif helpers.get_xml_attr(stream, 'streamType') == '2': + if audio_stream_info is None or helpers.get_xml_attr(stream, 'selected') == '1': + audio_stream_info = stream - elif helpers.get_xml_attr(stream, 'streamType') == '3' and helpers.get_xml_attr(stream, 'selected') == '1': - subtitle_stream_info = stream + elif helpers.get_xml_attr(stream, 'streamType') == '3': + if subtitle_stream_info is None or helpers.get_xml_attr(stream, 'selected') == '1': + subtitle_stream_info = stream video_id = audio_id = subtitle_id = None if video_stream_info: