Bug #74 - getting error on clients

This commit is contained in:
Michael Shepanski 2017-02-02 01:42:12 -05:00
parent 0aac1156a1
commit 16a55316f1

View file

@ -115,8 +115,7 @@ class PlexServer(object):
""" """
items = [] items = []
for elem in self.query('/clients'): for elem in self.query('/clients'):
baseurl = 'http://%s:%s' % (elem.attrib['address'], baseurl = 'http://%s:%s' % (elem.attrib['host'], elem.attrib['port'])
elem.attrib['port'])
items.append(PlexClient(baseurl, server=self, data=elem)) items.append(PlexClient(baseurl, server=self, data=elem))
return items return items
@ -135,8 +134,7 @@ class PlexServer(object):
""" """
for elem in self.query('/clients'): for elem in self.query('/clients'):
if elem.attrib.get('name').lower() == name.lower(): if elem.attrib.get('name').lower() == name.lower():
baseurl = 'http://%s:%s' % ( baseurl = 'http://%s:%s' % (elem.attrib['host'], elem.attrib['port'])
elem.attrib['address'], elem.attrib['port'])
return PlexClient(baseurl, server=self, data=elem) return PlexClient(baseurl, server=self, data=elem)
raise NotFound('Unknown client name: %s' % name) raise NotFound('Unknown client name: %s' % name)