mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-22 19:53:17 +00:00
only allow sections available agents to be used.
This commit is contained in:
parent
cea4f1944e
commit
b54f61d1cf
1 changed files with 2 additions and 2 deletions
|
@ -453,13 +453,13 @@ class PlexPartialObject(PlexObject):
|
|||
'year': year or self.year if self.section().type != 'artist' else '',
|
||||
'language': language or self.section().language}
|
||||
if agent:
|
||||
agents = self._server.agents()
|
||||
agents = self.section().agents()
|
||||
match_agent = next((ag for ag in agents if ag.shortIdentifier == agent), None)
|
||||
if match_agent:
|
||||
params['agent'] = match_agent.identifier
|
||||
else:
|
||||
raise NotFound('Couldnt find "%s" in agents list (%s)' %
|
||||
(agent, ','.join(agents.keys())))
|
||||
(agent, ', '.join([a.shortIdentifier for a in agents])))
|
||||
else:
|
||||
params['agent'] = self.section().agent
|
||||
|
||||
|
|
Loading…
Reference in a new issue