Added Field tag to video.

This commit is contained in:
logaritmisk 2016-10-02 22:05:37 +02:00
parent aa37f1b434
commit 1cb35da6f1
2 changed files with 13 additions and 0 deletions

View file

@ -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)

View file

@ -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')