mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-28 22:50:25 +00:00
MyPlex.settings slight clean up and property
This commit is contained in:
parent
277f2ea717
commit
226b9834f7
1 changed files with 3 additions and 3 deletions
|
@ -707,15 +707,15 @@ class MyPlexAccount(PlexObject):
|
|||
elem = self.query(url)
|
||||
return self.findItems(elem, cls=AccountOptOut, etag='optOut')
|
||||
|
||||
@property
|
||||
def settings(self):
|
||||
""" Returns an user account settings :class:`~plexapi.myplex.AccountSettings`
|
||||
"""
|
||||
req = requests.get(self.SETTINGS % {'userUUID': self.uuid} ,
|
||||
req = requests.get(self.SETTINGS % {'userUUID': self.uuid},
|
||||
headers={'X-Plex-Token': self._token,
|
||||
'X-Plex-Client-Identifier': X_PLEX_IDENTIFIER})
|
||||
elem = ElementTree.fromstring(req.text)
|
||||
for item in elem.iter('setting'):
|
||||
return AccountSettings(data=item, server=self._server)
|
||||
return self.findItems(elem, cls=AccountSettings, etag='setting')[0]
|
||||
|
||||
def link(self, pin):
|
||||
""" Link a device to the account using a pin code.
|
||||
|
|
Loading…
Reference in a new issue