mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-22 11:43:13 +00:00
add agents method to library
allow the searching for available agents for specific library
This commit is contained in:
parent
af586fa55d
commit
cea4f1944e
1 changed files with 10 additions and 0 deletions
|
@ -404,6 +404,16 @@ class LibrarySection(PlexObject):
|
|||
key = '/library/sections/%s/all%s' % (self.key, sortStr)
|
||||
return self.fetchItems(key, **kwargs)
|
||||
|
||||
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
|
||||
|
||||
def settings(self):
|
||||
""" Returns a list of all library settings. """
|
||||
key = '/library/sections/%s/prefs' % self.key
|
||||
|
|
Loading…
Reference in a new issue