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.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):
""" Contains the locally cached MyPlex account information. The properties provided don't