Skip to content

Commit 98226c0

Browse files
committed
use server.agents() mediaType keyword to shorten code
Thanks @JonnyWong16
1 parent 2ab3b61 commit 98226c0

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

plexapi/library.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,7 @@ def all(self, sort=None, **kwargs):
407407
def agents(self):
408408
""" Returns a list of available `:class:`~plexapi.media.Agent` for this library section.
409409
"""
410-
results = []
411-
for agent in self._server.agents():
412-
for agentType in agent.mediaTypes:
413-
if agentType.mediaType == utils.searchType(self.type):
414-
results.append(agent)
415-
return results
410+
return self._server.agents(utils.searchType(self.type))
416411

417412
def settings(self):
418413
""" Returns a list of all library settings. """

0 commit comments

Comments
 (0)