mirror of
https://github.com/pkkid/python-plexapi
synced 2024-09-20 22:01:57 +00:00
Add Chapters to Track (#1134)
Audiobooks in m4b containers support chapters as meta data. These are provided in the XML, but not included in the Track Object of the plexapi
This commit is contained in:
parent
b4c463aff8
commit
4946b4bc8b
1 changed files with 2 additions and 0 deletions
|
@ -372,6 +372,7 @@ class Track(
|
|||
Attributes:
|
||||
TAG (str): 'Directory'
|
||||
TYPE (str): 'track'
|
||||
chapters (List<:class:`~plexapi.media.Chapter`>): List of Chapter objects.
|
||||
chapterSource (str): Unknown
|
||||
collections (List<:class:`~plexapi.media.Collection`>): List of collection objects.
|
||||
duration (int): Length of the track in milliseconds.
|
||||
|
@ -407,6 +408,7 @@ class Track(
|
|||
""" Load attribute values from Plex XML response. """
|
||||
Audio._loadData(self, data)
|
||||
Playable._loadData(self, data)
|
||||
self.chapters = self.findItems(data, media.Chapter)
|
||||
self.chapterSource = data.attrib.get('chapterSource')
|
||||
self.collections = self.findItems(data, media.Collection)
|
||||
self.duration = utils.cast(int, data.attrib.get('duration'))
|
||||
|
|
Loading…
Reference in a new issue