mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-22 19:53:17 +00:00
use server.agents() mediaType keyword to shorten code
Thanks @jonnywong16
This commit is contained in:
parent
2ab3b61447
commit
98226c044b
1 changed files with 1 additions and 6 deletions
|
@ -407,12 +407,7 @@ class LibrarySection(PlexObject):
|
|||
def agents(self):
|
||||
""" Returns a list of available `:class:`~plexapi.media.Agent` for this library section.
|
||||
"""
|
||||
results = []
|
||||
for agent in self._server.agents():
|
||||
for agentType in agent.mediaTypes:
|
||||
if agentType.mediaType == utils.searchType(self.type):
|
||||
results.append(agent)
|
||||
return results
|
||||
return self._server.agents(utils.searchType(self.type))
|
||||
|
||||
def settings(self):
|
||||
""" Returns a list of all library settings. """
|
||||
|
|
Loading…
Reference in a new issue