mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-22 19:53:17 +00:00
Added Field tag to video.
This commit is contained in:
parent
aa37f1b434
commit
1cb35da6f1
2 changed files with 13 additions and 0 deletions
|
@ -186,3 +186,15 @@ class Producer(MediaTag): TYPE = 'Producer'; FILTER = 'producer'
|
|||
class Role(MediaTag): TYPE = 'Role'; FILTER = 'role'
|
||||
class Similar(MediaTag): TYPE = 'Similar'; FILTER = 'similar'
|
||||
class Writer(MediaTag): TYPE = 'Writer'; FILTER = 'writer'
|
||||
|
||||
|
||||
class Field(object):
|
||||
TYPE = 'Field'
|
||||
|
||||
def __init__(self, data):
|
||||
self.name = data.attrib.get('name')
|
||||
self.locked = cast(bool, data.attrib.get('locked'))
|
||||
|
||||
def __repr__(self):
|
||||
name = self.name.replace(' ', '.')[0:20]
|
||||
return '<%s:%s:%s>' % (self.__class__.__name__, name, self.locked)
|
||||
|
|
|
@ -89,6 +89,7 @@ class Movie(Video, Playable):
|
|||
self.producers = [media.Producer(self.server, e) for e in data if e.tag == media.Producer.TYPE]
|
||||
self.roles = [media.Role(self.server, e) for e in data if e.tag == media.Role.TYPE]
|
||||
self.writers = [media.Writer(self.server, e) for e in data if e.tag == media.Writer.TYPE]
|
||||
self.fields = [media.Field(e) for e in data if e.tag == media.Field.TYPE]
|
||||
self.videoStreams = utils.findStreams(self.media, 'videostream')
|
||||
self.audioStreams = utils.findStreams(self.media, 'audiostream')
|
||||
self.subtitleStreams = utils.findStreams(self.media, 'subtitlestream')
|
||||
|
|
Loading…
Reference in a new issue