def _loadData(self, data): """Used to set the attributes Args: data (Element): Usually built from server.query """ Video._loadData(self, data) # Incase this was loaded from search etc self.key = self.key.replace('/children', '') self.art = data.attrib.get('art', NA) self.banner = data.attrib.get('banner', NA) self.childCount = utils.cast(int, data.attrib.get('childCount', NA)) self.contentRating = data.attrib.get('contentRating', NA) self.duration = utils.cast(int, data.attrib.get('duration', NA)) self.guid = data.attrib.get('guid', NA) self.index = data.attrib.get('index', NA) self.leafCount = utils.cast(int, data.attrib.get('leafCount', NA)) self.location = utils.findLocations(data, single=True) or NA self.originallyAvailableAt = utils.toDatetime( data.attrib.get('originallyAvailableAt', NA), '%Y-%m-%d') self.rating = utils.cast(float, data.attrib.get('rating', NA)) self.studio = data.attrib.get('studio', NA) self.theme = data.attrib.get('theme', NA) self.viewedLeafCount = utils.cast( int, data.attrib.get('viewedLeafCount', NA)) self.year = utils.cast(int, data.attrib.get('year', NA)) if self.isFullObject(): # will be fixed with docs. self.genres = [ media.Genre(self.server, e) for e in data if e.tag == media.Genre.TYPE ] self.roles = [ media.Role(self.server, e) for e in data if e.tag == media.Role.TYPE ]
def _loadData(self, data): Video._loadData(self, data) self.art = data.attrib.get('art', NA) self.banner = data.attrib.get('banner', NA) self.childCount = utils.cast(int, data.attrib.get('childCount', NA)) self.contentRating = data.attrib.get('contentRating', NA) self.duration = utils.cast(int, data.attrib.get('duration', NA)) self.guid = data.attrib.get('guid', NA) self.index = data.attrib.get('index', NA) self.leafCount = utils.cast(int, data.attrib.get('leafCount', NA)) self.location = utils.findLocations(data, single=True) self.originallyAvailableAt = utils.toDatetime( data.attrib.get('originallyAvailableAt', NA), '%Y-%m-%d') self.rating = utils.cast(float, data.attrib.get('rating', NA)) self.studio = data.attrib.get('studio', NA) self.theme = data.attrib.get('theme', NA) self.viewedLeafCount = utils.cast( int, data.attrib.get('viewedLeafCount', NA)) self.year = utils.cast(int, data.attrib.get('year', NA)) if self.isFullObject(): self.genres = [ media.Genre(self.server, e) for e in data if e.tag == media.Genre.TYPE ] self.roles = [ media.Role(self.server, e) for e in data if e.tag == media.Role.TYPE ]
def _loadData(self, data): """Used to set the attributes. Args: data (Element): XML reponse from PMS as Element normally built from server.query """ Audio._loadData(self, data) self.art = data.attrib.get('art', NA) self.guid = data.attrib.get('guid', NA) self.key = self.key.replace('/children', '') # FIX_BUG_50 self.location = utils.findLocations(data, single=True) if self.isFullObject(): # check if this is needed self.countries = [ media.Country(self.server, e) for e in data if e.tag == media.Country.TYPE ] self.genres = [ media.Genre(self.server, e) for e in data if e.tag == media.Genre.TYPE ] self.similar = [ media.Similar(self.server, e) for e in data if e.tag == media.Similar.TYPE ]
def _loadData(self, data): Audio._loadData(self, data) self.art = data.attrib.get('art', NA) self.guid = data.attrib.get('guid', NA) self.key = self.key.replace('/children', '') # FIX_BUG_50 self.location = utils.findLocations(data, single=True) if self.isFullObject(): self.countries = [media.Country(self.server, e) for e in data if e.tag == media.Country.TYPE] self.genres = [media.Genre(self.server, e) for e in data if e.tag == media.Genre.TYPE] self.similar = [media.Similar(self.server, e) for e in data if e.tag == media.Similar.TYPE]
def _loadData(self, data): Audio._loadData(self, data) self.art = data.attrib.get('art', NA) self.guid = data.attrib.get('guid', NA) self.key = self.key.replace('/children', '') # FIX_BUG_50 self.location = utils.findLocations(data, single=True) if self.isFullObject(): self.countries = [ media.Country(self.server, e) for e in data if e.tag == media.Country.TYPE ] self.genres = [ media.Genre(self.server, e) for e in data if e.tag == media.Genre.TYPE ] self.similar = [ media.Similar(self.server, e) for e in data if e.tag == media.Similar.TYPE ]
def _loadData(self, data): Video._loadData(self, data) self.art = data.attrib.get('art', NA) self.banner = data.attrib.get('banner', NA) self.childCount = utils.cast(int, data.attrib.get('childCount', NA)) self.contentRating = data.attrib.get('contentRating', NA) self.duration = utils.cast(int, data.attrib.get('duration', NA)) self.guid = data.attrib.get('guid', NA) self.leafCount = utils.cast(int, data.attrib.get('leafCount', NA)) self.location = utils.findLocations(data, single=True) self.originallyAvailableAt = utils.toDatetime(data.attrib.get('originallyAvailableAt', NA), '%Y-%m-%d') self.rating = utils.cast(float, data.attrib.get('rating', NA)) self.studio = data.attrib.get('studio', NA) self.theme = data.attrib.get('theme', NA) self.viewedLeafCount = utils.cast(int, data.attrib.get('viewedLeafCount', NA)) self.year = utils.cast(int, data.attrib.get('year', NA)) if self.isFullObject(): self.genres = [media.Genre(self.server, e) for e in data if e.tag == media.Genre.TYPE] self.roles = [media.Role(self.server, e) for e in data if e.tag == media.Role.TYPE]
def __init__(self, server, data, initpath): self.server = server self.initpath = initpath self.agent = data.attrib.get('agent') self.allowSync = utils.cast(bool, data.attrib.get('allowSync')) self.art = data.attrib.get('art') self.composite = data.attrib.get('composite') self.createdAt = utils.toDatetime(data.attrib.get('createdAt')) self.filters = data.attrib.get('filters') self.key = data.attrib.get('key') self.language = data.attrib.get('language') self.language = data.attrib.get('language') self.locations = utils.findLocations(data) self.refreshing = utils.cast(bool, data.attrib.get('refreshing')) self.scanner = data.attrib.get('scanner') self.thumb = data.attrib.get('thumb') self.title = data.attrib.get('title') self.type = data.attrib.get('type') self.updatedAt = utils.toDatetime(data.attrib.get('updatedAt')) self.uuid = data.attrib.get('uuid')
def _loadData(self, data): """ Load attribute values from Plex XML response. """ Audio._loadData(self, data) self.art = data.attrib.get('art', NA) self.guid = data.attrib.get('guid', NA) self.key = self.key.replace('/children', '') # FIX_BUG_50 self.location = utils.findLocations(data, single=True) if self.isFullObject(): # check if this is needed self.countries = [ media.Country(self.server, e) for e in data if e.tag == media.Country.TYPE ] self.genres = [ media.Genre(self.server, e) for e in data if e.tag == media.Genre.TYPE ] self.similar = [ media.Similar(self.server, e) for e in data if e.tag == media.Similar.TYPE ]
def __init__(self, server, data, initpath): self._data = data self.server = server self.initpath = initpath self.agent = data.attrib.get('agent') self.allowSync = utils.cast(bool, data.attrib.get('allowSync')) self.art = data.attrib.get('art') self.composite = data.attrib.get('composite') self.createdAt = utils.toDatetime(data.attrib.get('createdAt')) self.filters = data.attrib.get('filters') self.key = data.attrib.get('key') self.language = data.attrib.get('language') self.locations = utils.findLocations(data) self.refreshing = utils.cast(bool, data.attrib.get('refreshing')) self.scanner = data.attrib.get('scanner') self.thumb = data.attrib.get('thumb') self.title = data.attrib.get('title') self.type = data.attrib.get('type') self.updatedAt = utils.toDatetime(data.attrib.get('updatedAt')) self.uuid = data.attrib.get('uuid')