Skip to content

Commit

Permalink
add opt out. untested so dont merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellowlol committed Oct 3, 2017
1 parent b385b76 commit a4443db
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plexapi/base.py
Expand Up @@ -488,6 +488,11 @@ def iterParts(self):
for part in item.parts:
yield part

def split(self):
"""Split a duplicate."""
key = '%s/split' % self.key
return self._server.query(key)

def play(self, client):
""" Start playback on the specified client.
Expand Down
16 changes: 16 additions & 0 deletions plexapi/myplex.py
Expand Up @@ -361,6 +361,22 @@ def webhooks(self):
self._webhooks = self.listAttrs(data, 'url', etag='webhook')
return self._webhooks

def opt(self, playback=None, library=None):
"""Opt in or out of sharing stuff with plex. See
https://www.plex.tv/about/privacy-legal/
"""
params = {}
if playback is not None:
params['optOutPlayback'] = int(playback)
if library is not None:
params['optOutLibraryStats'] = int(library)

url = 'https://plex.tv/api/v2/user/privacy'

return self.query(url, method=self._session.put, **dict(params=params))


class MyPlexUser(PlexObject):
""" This object represents non-signed in users such as friends and linked
Expand Down

0 comments on commit a4443db

Please sign in to comment.