Some lint and silence the error

This commit is contained in:
Hellowlol 2020-03-14 15:35:56 +01:00
parent 47950201b0
commit 06ca74dbce

View file

@ -1,5 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from plexapi import log, utils, compat
import xml
from plexapi import compat, log, utils
from plexapi.base import PlexObject from plexapi.base import PlexObject
from plexapi.exceptions import BadRequest from plexapi.exceptions import BadRequest
from plexapi.utils import cast from plexapi.utils import cast
@ -143,7 +146,7 @@ class MediaPart(PlexObject):
def setDefaultSubtitleStream(self, stream): def setDefaultSubtitleStream(self, stream):
""" Set the default :class:`~plexapi.media.SubtitleStream` for this MediaPart. """ Set the default :class:`~plexapi.media.SubtitleStream` for this MediaPart.
Parameters: Parameters:
stream (:class:`~plexapi.media.SubtitleStream`): SubtitleStream to set as default. stream (:class:`~plexapi.media.SubtitleStream`): SubtitleStream to set as default.
""" """
@ -370,38 +373,38 @@ class Conversion(PlexObject):
TAG = 'Video' TAG = 'Video'
def _loadData(self, data): def _loadData(self, data):
self._data = data self._data = data
self.addedAt = data.attrib.get('addedAt') self.addedAt = data.attrib.get('addedAt')
self.art = data.attrib.get('art') self.art = data.attrib.get('art')
self.chapterSource = data.attrib.get('chapterSource') self.chapterSource = data.attrib.get('chapterSource')
self.contentRating = data.attrib.get('contentRating') self.contentRating = data.attrib.get('contentRating')
self.duration = data.attrib.get('duration') self.duration = data.attrib.get('duration')
self.generatorID = data.attrib.get('generatorID') self.generatorID = data.attrib.get('generatorID')
self.generatorType = data.attrib.get('generatorType') self.generatorType = data.attrib.get('generatorType')
self.guid = data.attrib.get('guid') self.guid = data.attrib.get('guid')
self.key = data.attrib.get('key') self.key = data.attrib.get('key')
self.lastViewedAt = data.attrib.get('lastViewedAt') self.lastViewedAt = data.attrib.get('lastViewedAt')
self.librarySectionID = data.attrib.get('librarySectionID') self.librarySectionID = data.attrib.get('librarySectionID')
self.librarySectionKey = data.attrib.get('librarySectionKey') self.librarySectionKey = data.attrib.get('librarySectionKey')
self.librarySectionTitle = data.attrib.get('librarySectionTitle') self.librarySectionTitle = data.attrib.get('librarySectionTitle')
self.originallyAvailableAt = data.attrib.get('originallyAvailableAt') self.originallyAvailableAt = data.attrib.get('originallyAvailableAt')
self.playQueueItemID = data.attrib.get('playQueueItemID') self.playQueueItemID = data.attrib.get('playQueueItemID')
self.playlistID = data.attrib.get('playlistID') self.playlistID = data.attrib.get('playlistID')
self.primaryExtraKey = data.attrib.get('primaryExtraKey') self.primaryExtraKey = data.attrib.get('primaryExtraKey')
self.rating = data.attrib.get('rating') self.rating = data.attrib.get('rating')
self.ratingKey = data.attrib.get('ratingKey') self.ratingKey = data.attrib.get('ratingKey')
self.studio = data.attrib.get('studio') self.studio = data.attrib.get('studio')
self.summary = data.attrib.get('summary') self.summary = data.attrib.get('summary')
self.tagline = data.attrib.get('tagline') self.tagline = data.attrib.get('tagline')
self.target = data.attrib.get('target') self.target = data.attrib.get('target')
self.thumb = data.attrib.get('thumb') self.thumb = data.attrib.get('thumb')
self.title = data.attrib.get('title') self.title = data.attrib.get('title')
self.type = data.attrib.get('type') self.type = data.attrib.get('type')
self.updatedAt = data.attrib.get('updatedAt') self.updatedAt = data.attrib.get('updatedAt')
self.userID = data.attrib.get('userID') self.userID = data.attrib.get('userID')
self.username = data.attrib.get('username') self.username = data.attrib.get('username')
self.viewOffset = data.attrib.get('viewOffset') self.viewOffset = data.attrib.get('viewOffset')
self.year = data.attrib.get('year') self.year = data.attrib.get('year')
class MediaTag(PlexObject): class MediaTag(PlexObject):
@ -560,7 +563,10 @@ class Poster(PlexObject):
def select(self): def select(self):
key = self._initpath[:-1] key = self._initpath[:-1]
data = '%s?url=%s' % (key, compat.quote_plus(self.ratingKey)) data = '%s?url=%s' % (key, compat.quote_plus(self.ratingKey))
self._server.query(data, method=self._server._session.put) try:
self._server.query(data, method=self._server._session.put)
except xml.etree.ElementTree.ParseError:
pass
@utils.registerPlexObject @utils.registerPlexObject