示例#1
0
 def _loadData(self, data):
     Audio._loadData(self, data)
     Playable._loadData(self, data)
     self.art = data.attrib.get('art', NA)
     self.chapterSource = data.attrib.get('chapterSource', NA)
     self.duration = utils.cast(int, data.attrib.get('duration', NA))
     self.grandparentArt = data.attrib.get('grandparentArt', NA)
     self.grandparentKey = data.attrib.get('grandparentKey', NA)
     self.grandparentRatingKey = data.attrib.get('grandparentRatingKey', NA)
     self.grandparentThumb = data.attrib.get('grandparentThumb', NA)
     self.grandparentTitle = data.attrib.get('grandparentTitle', NA)
     self.guid = data.attrib.get('guid', NA)
     self.originalTitle = data.attrib.get('originalTitle', NA)
     self.parentIndex = data.attrib.get('parentIndex', NA)
     self.parentKey = data.attrib.get('parentKey', NA)
     self.parentRatingKey = data.attrib.get('parentRatingKey', NA)
     self.parentThumb = data.attrib.get('parentThumb', NA)
     self.parentTitle = data.attrib.get('parentTitle', NA)
     self.primaryExtraKey = data.attrib.get('primaryExtraKey', NA)
     self.ratingCount = utils.cast(int, data.attrib.get('ratingCount', NA))
     self.viewOffset = utils.cast(int, data.attrib.get('viewOffset', 0))
     self.year = utils.cast(int, data.attrib.get('year', NA))
     if self.isFullObject():
         self.moods = [media.Mood(self.server, e) for e in data if e.tag == media.Mood.TYPE]
         self.media = [media.Media(self.server, e, self.initpath, self) for e in data if e.tag == media.Media.TYPE]
     # data for active sessions and history
     self.sessionKey = utils.cast(int, data.attrib.get('sessionKey', NA))
     self.username = utils.findUsername(data)
     self.player = utils.findPlayer(self.server, data)
     self.transcodeSession = utils.findTranscodeSession(self.server, data)
示例#2
0
 def _loadData(self, data):
     Video._loadData(self, data)
     Playable._loadData(self, data)
     self.art = data.attrib.get("art", NA)
     self.chapterSource = data.attrib.get("chapterSource", NA)
     self.contentRating = data.attrib.get("contentRating", NA)
     self.duration = utils.cast(int, data.attrib.get("duration", NA))
     self.grandparentArt = data.attrib.get("grandparentArt", NA)
     self.grandparentKey = data.attrib.get("grandparentKey", NA)
     self.grandparentRatingKey = data.attrib.get("grandparentRatingKey", NA)
     self.grandparentTheme = data.attrib.get("grandparentTheme", NA)
     self.grandparentThumb = data.attrib.get("grandparentThumb", NA)
     self.grandparentTitle = data.attrib.get("grandparentTitle", NA)
     self.guid = data.attrib.get("guid", NA)
     self.originallyAvailableAt = utils.toDatetime(data.attrib.get("originallyAvailableAt", NA), "%Y-%m-%d")
     self.parentIndex = data.attrib.get("parentIndex", NA)
     self.parentKey = data.attrib.get("parentKey", NA)
     self.parentRatingKey = data.attrib.get("parentRatingKey", NA)
     self.parentThumb = data.attrib.get("parentThumb", NA)
     self.rating = utils.cast(float, data.attrib.get("rating", NA))
     self.viewOffset = utils.cast(int, data.attrib.get("viewOffset", 0))
     self.year = utils.cast(int, data.attrib.get("year", NA))
     if self.isFullObject():
         self.directors = [media.Director(self.server, e) for e in data if e.tag == media.Director.TYPE]
         self.media = [media.Media(self.server, e, self.initpath, self) for e in data if e.tag == media.Media.TYPE]
         self.writers = [media.Writer(self.server, e) for e in data if e.tag == media.Writer.TYPE]
         self.videoStreams = utils.findStreams(self.media, "videostream")
         self.audioStreams = utils.findStreams(self.media, "audiostream")
         self.subtitleStreams = utils.findStreams(self.media, "subtitlestream")
     # data for active sessions and history
     self.sessionKey = utils.cast(int, data.attrib.get("sessionKey", NA))
     self.username = utils.findUsername(data)
     self.player = utils.findPlayer(self.server, data)
     self.transcodeSession = utils.findTranscodeSession(self.server, data)
示例#3
0
    def _loadData(self, data):
        """Used to set the attributes

            Args:
                data (Element): Usually built from server.query
        """
        Video._loadData(self, data)
        Playable._loadData(self, data)
        self.art = data.attrib.get('art', NA)
        self.chapterSource = data.attrib.get('chapterSource', NA)
        self.contentRating = data.attrib.get('contentRating', NA)
        self.duration = utils.cast(int, data.attrib.get('duration', NA))
        self.grandparentArt = data.attrib.get('grandparentArt', NA)
        self.grandparentKey = data.attrib.get('grandparentKey', NA)
        self.grandparentRatingKey = utils.cast(
            int, data.attrib.get('grandparentRatingKey', NA))
        self.grandparentTheme = data.attrib.get('grandparentTheme', NA)
        self.grandparentThumb = data.attrib.get('grandparentThumb', NA)
        self.grandparentTitle = data.attrib.get('grandparentTitle', NA)
        self.guid = data.attrib.get('guid', NA)
        self.index = utils.cast(int, data.attrib.get('index', NA))
        self.originallyAvailableAt = utils.toDatetime(
            data.attrib.get('originallyAvailableAt', NA), '%Y-%m-%d')
        self.parentIndex = data.attrib.get('parentIndex', NA)
        self.parentKey = data.attrib.get('parentKey', NA)
        self.parentRatingKey = utils.cast(
            int, data.attrib.get('parentRatingKey', NA))
        self.parentThumb = data.attrib.get('parentThumb', NA)
        self.rating = utils.cast(float, data.attrib.get('rating', NA))
        self.viewOffset = utils.cast(int, data.attrib.get('viewOffset', 0))
        self.year = utils.cast(int, data.attrib.get('year', NA))
        self.directors = [
            media.Director(self.server, e) for e in data
            if e.tag == media.Director.TYPE
        ]
        self.media = [
            media.Media(self.server, e, self.initpath, self) for e in data
            if e.tag == media.Media.TYPE
        ]
        self.writers = [
            media.Writer(self.server, e) for e in data
            if e.tag == media.Writer.TYPE
        ]
        self.videoStreams = utils.findStreams(self.media, 'videostream')
        self.audioStreams = utils.findStreams(self.media, 'audiostream')
        self.subtitleStreams = utils.findStreams(self.media, 'subtitlestream')
        # data for active sessions and history
        self.sessionKey = utils.cast(int, data.attrib.get('sessionKey', NA))
        self.username = utils.findUsername(data)
        self.player = utils.findPlayer(self.server, data)
        self.transcodeSession = utils.findTranscodeSession(self.server, data)
        # Cached season number
        self._seasonNumber = None
示例#4
0
    def _loadData(self, data):
        """Used to set the attributes

        Args:
            data (Element): Usually built from server.query
        """
        Audio._loadData(self, data)
        Playable._loadData(self, data)
        self.art = data.attrib.get('art', NA)
        self.chapterSource = data.attrib.get('chapterSource', NA)
        self.duration = utils.cast(int, data.attrib.get('duration', NA))
        self.grandparentArt = data.attrib.get('grandparentArt', NA)
        self.grandparentKey = data.attrib.get('grandparentKey', NA)
        self.grandparentRatingKey = data.attrib.get('grandparentRatingKey', NA)
        self.grandparentThumb = data.attrib.get('grandparentThumb', NA)
        self.grandparentTitle = data.attrib.get('grandparentTitle', NA)
        self.guid = data.attrib.get('guid', NA)
        self.originalTitle = data.attrib.get('originalTitle', NA)
        self.parentIndex = data.attrib.get('parentIndex', NA)
        self.parentKey = data.attrib.get('parentKey', NA)
        self.parentRatingKey = data.attrib.get('parentRatingKey', NA)
        self.parentThumb = data.attrib.get('parentThumb', NA)
        self.parentTitle = data.attrib.get('parentTitle', NA)
        self.primaryExtraKey = data.attrib.get('primaryExtraKey', NA)
        self.ratingCount = utils.cast(int, data.attrib.get('ratingCount', NA))
        self.viewOffset = utils.cast(int, data.attrib.get('viewOffset', 0))
        self.year = utils.cast(int, data.attrib.get('year', NA))
        if self.isFullObject():  # check me
            self.moods = [
                media.Mood(self.server, e) for e in data
                if e.tag == media.Mood.TYPE
            ]
            self.media = [
                media.Media(self.server, e, self.initpath, self) for e in data
                if e.tag == media.Media.TYPE
            ]
        # data for active sessions and history
        self.sessionKey = utils.cast(int, data.attrib.get('sessionKey', NA))
        self.username = utils.findUsername(data)
        self.player = utils.findPlayer(self.server, data)
        self.transcodeSession = utils.findTranscodeSession(self.server, data)
示例#5
0
 def _loadData(self, data):
     """ Load attribute values from Plex XML response. """
     Audio._loadData(self, data)
     Playable._loadData(self, data)
     self.art = data.attrib.get('art', NA)
     self.chapterSource = data.attrib.get('chapterSource', NA)
     self.duration = utils.cast(int, data.attrib.get('duration', NA))
     self.grandparentArt = data.attrib.get('grandparentArt', NA)
     self.grandparentKey = data.attrib.get('grandparentKey', NA)
     self.grandparentRatingKey = data.attrib.get('grandparentRatingKey', NA)
     self.grandparentThumb = data.attrib.get('grandparentThumb', NA)
     self.grandparentTitle = data.attrib.get('grandparentTitle', NA)
     self.guid = data.attrib.get('guid', NA)
     self.originalTitle = data.attrib.get('originalTitle', NA)
     self.parentIndex = data.attrib.get('parentIndex', NA)
     self.parentKey = data.attrib.get('parentKey', NA)
     self.parentRatingKey = data.attrib.get('parentRatingKey', NA)
     self.parentThumb = data.attrib.get('parentThumb', NA)
     self.parentTitle = data.attrib.get('parentTitle', NA)
     self.primaryExtraKey = data.attrib.get('primaryExtraKey', NA)
     self.ratingCount = utils.cast(int, data.attrib.get('ratingCount', NA))
     self.viewOffset = utils.cast(int, data.attrib.get('viewOffset', 0))
     self.year = utils.cast(int, data.attrib.get('year', NA))
     # media is included in /children
     self.media = [
         media.Media(self.server, e, self.initpath, self) for e in data
         if e.tag == media.Media.TYPE
     ]
     if self.isFullObject():  # check me
         self.moods = [
             media.Mood(self.server, e) for e in data
             if e.tag == media.Mood.TYPE
         ]
         #self.media = [media.Media(self.server, e, self.initpath, self)
         #              for e in data if e.tag == media.Media.TYPE]
     # data for active sessions and history
     self.sessionKey = utils.cast(int, data.attrib.get('sessionKey', NA))
     self.username = utils.findUsername(data)
     self.player = utils.findPlayer(self.server, data)
     self.transcodeSession = utils.findTranscodeSession(self.server, data)
示例#6
0
 def _loadData(self, data):
     Video._loadData(self, data)
     Playable._loadData(self, data)
     self.art = data.attrib.get('art', NA)
     self.chapterSource = data.attrib.get('chapterSource', NA)
     self.contentRating = data.attrib.get('contentRating', NA)
     self.duration = utils.cast(int, data.attrib.get('duration', NA))
     self.grandparentArt = data.attrib.get('grandparentArt', NA)
     self.grandparentKey = data.attrib.get('grandparentKey', NA)
     self.grandparentRatingKey = data.attrib.get('grandparentRatingKey', NA)
     self.grandparentTheme = data.attrib.get('grandparentTheme', NA)
     self.grandparentThumb = data.attrib.get('grandparentThumb', NA)
     self.grandparentTitle = data.attrib.get('grandparentTitle', NA)
     self.guid = data.attrib.get('guid', NA)
     self.originallyAvailableAt = utils.toDatetime(data.attrib.get('originallyAvailableAt', NA), '%Y-%m-%d')
     self.parentIndex = data.attrib.get('parentIndex', NA)
     self.parentKey = data.attrib.get('parentKey', NA)
     self.parentRatingKey = data.attrib.get('parentRatingKey', NA)
     self.parentThumb = data.attrib.get('parentThumb', NA)
     self.rating = utils.cast(float, data.attrib.get('rating', NA))
     self.viewOffset = utils.cast(int, data.attrib.get('viewOffset', 0))
     self.year = utils.cast(int, data.attrib.get('year', NA))
     if self.isFullObject():
         self.directors = [media.Director(self.server, e) for e in data if e.tag == media.Director.TYPE]
         self.media = [media.Media(self.server, e, self.initpath, self) for e in data if e.tag == media.Media.TYPE]
         self.writers = [media.Writer(self.server, e) for e in data if e.tag == media.Writer.TYPE]
         self.videoStreams = utils.findStreams(self.media, 'videostream')
         self.audioStreams = utils.findStreams(self.media, 'audiostream')
         self.subtitleStreams = utils.findStreams(self.media, 'subtitlestream')
     # data for active sessions and history
     self.sessionKey = utils.cast(int, data.attrib.get('sessionKey', NA))
     self.username = utils.findUsername(data)
     self.player = utils.findPlayer(self.server, data)
     self.transcodeSession = utils.findTranscodeSession(self.server, data)
     self.episode_number = data.attrib.get("index")
     if "parentIndex" in data:
         self.season_number = data.attrib.get("parentIndex")
     else:
         self.season_number = self.season().season_number