Replace findItems with fetchItems

This commit is contained in:
JonnyWong16 2021-01-03 10:41:38 -08:00
parent f0b680426f
commit 345d0b2743
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -218,15 +218,15 @@ class PlexServer(PlexObject):
def systemAccounts(self):
""" Returns a list of :class:`~plexapi.server.SystemAccounts` objects this server contains. """
if self._systemAccounts is None:
data = self.query('/accounts')
self._systemAccounts = self.findItems(data, SystemAccount)
key = '/accounts'
self._systemAccounts = self.fetchItems(key, SystemAccount)
return self._systemAccounts
def systemDevices(self):
""" Returns a list of :class:`~plexapi.server.SystemDevices` objects this server contains. """
if self._systemDevices is None:
data = self.query('/devices')
self._systemDevices = self.findItems(data, SystemDevice)
key = '/devices'
self._systemDevices = self.fetchItems(key, SystemDevice)
return self._systemDevices
def myPlexAccount(self):
@ -705,15 +705,13 @@ class PlexServer(PlexObject):
params[key] = value
key = '/statistics/bandwidth?%s' % urlencode(params)
data = self.query(key)
return self.findItems(data, StatisticsBandwidth)
return self.fetchItems(key, StatisticsBandwidth)
def resources(self):
""" Returns a list of :class:`~plexapi.server.StatisticsResources` objects
with the Plex server dashboard resources data. """
key = '/statistics/resources?timespan=6'
data = self.query(key)
return self.findItems(data, StatisticsResources)
return self.fetchItems(key, StatisticsResources)
class Account(PlexObject):