Closed mcpowell87 closed 2 years ago
Thank you @mcpowell87 for the PR.
The AudioStream
and SubtitleStream
classes both inherits from the base class MediaPartStream
which have the attributes title
and codec
, see here.
Here is an example of the command vars(subtitle)
in Python:
{'_server': <PlexServer:http://****/>,
'_data': <Element 'Stream' at 0x7fc77a2e7540>,
'_initpath': '/library/metadata/28669',
'_parent': <weakref at 0x7fc77a278540; to 'MediaPart' at 0x7fc77ad30250>,
'_details_key': None,
'bitrate': 0,
'codec': 'srt',
'default': True,
'displayTitle': 'Français Forced (SRT)',
'extendedDisplayTitle': 'French [Forced] (Français SRT)',
'key': None,
'id': 186482,
'index': 3,
'language': 'Français',
'languageCode': 'fra',
'requiredBandwidths': None,
'selected': False,
'streamType': 3,
'title': 'French [Forced]',
'type': 3,
'container': None,
'forced': True,
'format': None,
'headerCompression': None,
'transient': None,
'_autoReload': False,
'_edits': None}
However you are right for pointing issues on those lines:
==
instead of a <=
None
thus producing an errorI'm closing this PR as the fixes have been merged in #7, thank you for bringing attention to the issue !
AudioStreams were being compared by title, which is not part of that object. SubtitleStreams were being compared by title and codec, both of which are not part of the object.
I was using the following guide as a reference Python PlexAPI Doc
I tested this locally by changing both the audio stream and subtitle and saw the intended behavior of subtitles/audio being set for the show, so I think this should resolve issue #4