mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-10 14:14:19 +00:00
Simplify call
This commit is contained in:
parent
6ef1e9c8f4
commit
23a5ad695b
1 changed files with 7 additions and 10 deletions
|
@ -202,19 +202,16 @@ class PlexClient(PlexObject):
|
|||
|
||||
proxy = self._proxyThroughServer if proxy is None else proxy
|
||||
|
||||
if self.product in ('Plexamp'):
|
||||
try:
|
||||
if proxy:
|
||||
return self._server.query(key, headers=headers)
|
||||
return self.query(key, headers=headers)
|
||||
except ElementTree.ParseError:
|
||||
# Workaround for players which don't return valid XML on successful commands
|
||||
# - Plexamp: `b'OK'`
|
||||
try:
|
||||
if proxy:
|
||||
return self._server.query(key, headers=headers)
|
||||
return self.query(key, headers=headers)
|
||||
except ElementTree.ParseError:
|
||||
return None
|
||||
if self.product not in ('Plexamp'):
|
||||
raise
|
||||
|
||||
if proxy:
|
||||
return self._server.query(key, headers=headers)
|
||||
return self.query(key, headers=headers)
|
||||
|
||||
def url(self, key, includeToken=False):
|
||||
""" Build a URL string with proper token argument. Token will be appended to the URL
|
||||
|
|
Loading…
Reference in a new issue