create _allowMediaDeletion method in server.py

This commit is contained in:
blacktwin 2020-02-25 16:39:49 -05:00
parent c3e16b2d36
commit ba75935e0b

View file

@ -493,6 +493,15 @@ class PlexServer(PlexObject):
self.refreshSynclist() self.refreshSynclist()
self.refreshContent() self.refreshContent()
def _allowMediaDeletion(self, toggle):
""" Toggle allowMediaDeletion.
Parameters:
toggle (bool): True enables Media Deletion
False or None disable Media Deletion
"""
value = 1 if toggle is True else 0
return self.query('/:/prefs?allowMediaDeletion=%s' % value, self._session.put)
class Account(PlexObject): class Account(PlexObject):
""" Contains the locally cached MyPlex account information. The properties provided don't """ Contains the locally cached MyPlex account information. The properties provided don't