mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-10 14:14:19 +00:00
Merge pull request #141 from centicosm/master
Fixed regression involving invalid token requirement
This commit is contained in:
commit
71341def2d
2 changed files with 3 additions and 3 deletions
|
@ -171,8 +171,8 @@ class PlexClient(PlexObject):
|
|||
|
||||
def url(self, key):
|
||||
""" Build a URL string with proper token argument. """
|
||||
if not self._baseurl or not self._token:
|
||||
raise BadRequest('PlexClient object missing baseurl or token.')
|
||||
if not self._baseurl:
|
||||
raise BadRequest('PlexClient object missing baseurl.')
|
||||
if self._token:
|
||||
delim = '&' if '?' in key else '?'
|
||||
return '%s%s%sX-Plex-Token=%s' % (self._baseurl, key, delim, self._token)
|
||||
|
|
|
@ -208,7 +208,7 @@ class PlexServer(PlexObject):
|
|||
for elem in self.query('/clients'):
|
||||
if elem.attrib.get('name').lower() == name.lower():
|
||||
baseurl = 'http://%s:%s' % (elem.attrib['host'], elem.attrib['port'])
|
||||
return PlexClient(baseurl, server=self, data=elem)
|
||||
return PlexClient(baseurl=baseurl, server=self, data=elem)
|
||||
raise NotFound('Unknown client name: %s' % name)
|
||||
|
||||
def createPlaylist(self, title, items):
|
||||
|
|
Loading…
Reference in a new issue