Skip to content

Commit 25ac612

Browse files
committed
Merge branch 'master' of github.com:pkkid/python-plexapi
2 parents 591579a + e818094 commit 25ac612

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

plexapi/myplex.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ def query(self, url, method=None, headers=None, timeout=None, **kwargs):
172172
if response.status_code not in (200, 201, 204): # pragma: no cover
173173
codename = codes.get(response.status_code)[0]
174174
errtext = response.text.replace('\n', ' ')
175-
log.warning('BadRequest (%s) %s %s; %s' % (response.status_code, codename, response.url, errtext))
176175
raise BadRequest('(%s) %s %s; %s' % (response.status_code, codename, response.url, errtext))
177176
data = response.text.encode('utf8')
178177
return ElementTree.fromstring(data) if data.strip() else None
@@ -487,7 +486,6 @@ def claimToken(self):
487486
if response.status_code not in (200, 201, 204): # pragma: no cover
488487
codename = codes.get(response.status_code)[0]
489488
errtext = response.text.replace('\n', ' ')
490-
log.warning('BadRequest (%s) %s %s; %s' % (response.status_code, codename, response.url, errtext))
491489
raise BadRequest('(%s) %s %s; %s' % (response.status_code, codename, response.url, errtext))
492490
return response.json()['token']
493491

plexapi/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def toDatetime(value, format=None):
181181
# https://bugs.python.org/issue30684
182182
# And platform support for before epoch seems to be flaky.
183183
# TODO check for others errors too.
184-
if int(value) == 0:
184+
if int(value) <= 0:
185185
value = 86400
186186
value = datetime.fromtimestamp(int(value))
187187
return value

plexapi/video.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ class Show(Video):
262262
banner (str): Key to banner artwork (/library/metadata/<ratingkey>/art/<artid>)
263263
childCount (int): Unknown.
264264
contentRating (str) Content rating (PG-13; NR; TV-G).
265+
collections (List<:class:`~plexapi.media.Collection`>): List of collections this media belongs.
265266
duration (int): Duration of show in milliseconds.
266267
guid (str): Plex GUID (com.plexapp.agents.imdb://tt4302938?lang=en).
267268
index (int): Plex index (?)
@@ -294,6 +295,7 @@ def _loadData(self, data):
294295
self.banner = data.attrib.get('banner')
295296
self.childCount = utils.cast(int, data.attrib.get('childCount'))
296297
self.contentRating = data.attrib.get('contentRating')
298+
self.collections = self.findItems(data, media.Collection)
297299
self.duration = utils.cast(int, data.attrib.get('duration'))
298300
self.guid = data.attrib.get('guid')
299301
self.index = data.attrib.get('index')

0 commit comments

Comments
 (0)