mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-26 05:30:20 +00:00
Add removeHomeUser
Add ability to remove a Home User. If Home User is an Existing Plex User then User will go back into Sharing/Friends with sections and settings carrying over. Any Home User settings (LiveTV) are removed.
This commit is contained in:
parent
a7df2a9ed8
commit
654f25b3f8
1 changed files with 11 additions and 0 deletions
|
@ -67,6 +67,7 @@ class MyPlexAccount(PlexObject):
|
|||
FRIENDSERVERS = 'https://plex.tv/api/servers/{machineId}/shared_servers/{serverId}' # put with data
|
||||
PLEXSERVERS = 'https://plex.tv/api/servers/{machineId}' # get
|
||||
FRIENDUPDATE = 'https://plex.tv/api/friends/{userId}' # put with args, delete
|
||||
REMOVEHOMEUSER = 'https://plex.tv/api/home/users/{userId}' # delete
|
||||
REMOVEINVITE = 'https://plex.tv/api/invites/requested/{userId}?friend=0&server=1&home=0' # delete
|
||||
REQUESTED = 'https://plex.tv/api/invites/requested' # get
|
||||
REQUESTS = 'https://plex.tv/api/invites/requests' # get
|
||||
|
@ -339,6 +340,16 @@ class MyPlexAccount(PlexObject):
|
|||
url = url.format(userId=user.id)
|
||||
return self.query(url, self._session.delete)
|
||||
|
||||
def removeHomeUser(self, user):
|
||||
""" Remove the specified managed user from home.
|
||||
|
||||
Parameters:
|
||||
user (str): MyPlexUser, username, email of the user to be removed from home.
|
||||
"""
|
||||
user = self.user(user)
|
||||
url = self.REMOVEHOMEUSER.format(userId=user.id)
|
||||
return self.query(url, self._session.delete)
|
||||
|
||||
def updateFriend(self, user, server, sections=None, removeSections=False, allowSync=None, allowCameraUpload=None,
|
||||
allowChannels=None, filterMovies=None, filterTelevision=None, filterMusic=None):
|
||||
""" Update the specified user's share settings.
|
||||
|
|
Loading…
Reference in a new issue