Update plexapi==4.13.4

This commit is contained in:
JonnyWong16 2023-03-10 11:06:27 -08:00
parent b7da2dedf3
commit eb7495e930
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
18 changed files with 187 additions and 75 deletions

View file

@ -399,6 +399,10 @@ class AudioStream(MediaPartStream):
self.peak = utils.cast(float, data.attrib.get('peak'))
self.startRamp = data.attrib.get('startRamp')
def setDefault(self):
""" Sets this audio stream as the default audio stream. """
return self._parent().setDefaultAudioStream(self)
@utils.registerPlexObject
class SubtitleStream(MediaPartStream):
@ -425,6 +429,10 @@ class SubtitleStream(MediaPartStream):
self.headerCompression = data.attrib.get('headerCompression')
self.transient = data.attrib.get('transient')
def setDefault(self):
""" Sets this subtitle stream as the default subtitle stream. """
return self._parent().setDefaultSubtitleStream(self)
class LyricStream(MediaPartStream):
""" Represents a lyric stream within a :class:`~plexapi.media.MediaPart`.
@ -1037,9 +1045,11 @@ class Marker(PlexObject):
Attributes:
TAG (str): 'Marker'
end (int): The end time of the marker in milliseconds.
final (bool): True if the marker is the final credits marker.
id (int): The ID of the marker.
type (str): The type of marker.
start (int): The start time of the marker in milliseconds.
version (int): The Plex marker version.
"""
TAG = 'Marker'
@ -1053,10 +1063,25 @@ class Marker(PlexObject):
def _loadData(self, data):
self._data = data
self.end = utils.cast(int, data.attrib.get('endTimeOffset'))
self.final = utils.cast(bool, data.attrib.get('final'))
self.id = utils.cast(int, data.attrib.get('id'))
self.type = data.attrib.get('type')
self.start = utils.cast(int, data.attrib.get('startTimeOffset'))
attributes = data.find('Attributes')
self.version = attributes.attrib.get('version')
@property
def first(self):
""" Returns True if the marker in the first credits marker. """
if self.type != 'credits':
return None
first = min(
(marker for marker in self._parent().markers if marker.type == 'credits'),
key=lambda m: m.start
)
return first == self
@utils.registerPlexObject
class Field(PlexObject):