File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,25 @@ def audioStreams(self):
124124 def subtitleStreams (self ):
125125 """ Returns a list of :class:`~plexapi.media.SubtitleStream` objects in this MediaPart. """
126126 return [stream for stream in self .streams if stream .streamType == SubtitleStream .STREAMTYPE ]
127+
128+ def setDefaultAudioStream (self , id ):
129+ """ Set the default :class:`~plexapi.media.AudioStream` for this MediaPart.
130+
131+ Parameters:
132+ id (int): ID of the AudioStream to set
133+ """
134+ key = "/library/parts/%d?audioStreamID=%d&allParts=1" % (self .id , id )
135+ self ._server .query (key , method = self ._server ._session .put )
136+
137+ def setDefaultSubtitleStream (self , id ):
138+ """ Set the default :class:`~plexapi.media.SubtitleStream` for this MediaPart.
139+
140+ Parameters:
141+ id (int): ID of the SubtitleStream to set (0 for no subtitles)
142+ """
143+ key = "/library/parts/%d?subtitleStreamID=%d&allParts=1" % (self .id , id )
144+ self ._server .query (key , method = self ._server ._session .put )
145+
127146
128147
129148class MediaPartStream (PlexObject ):
You can’t perform that action at this time.
0 commit comments