mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-26 05:30:20 +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 '',
|
'year': year or self.year if self.section().type != 'artist' else '',
|
||||||
'language': language or self.section().language}
|
'language': language or self.section().language}
|
||||||
if agent:
|
if agent:
|
||||||
agents = self._server.agents()
|
agents = self.section().agents()
|
||||||
match_agent = next((ag for ag in agents if ag.shortIdentifier == agent), None)
|
match_agent = next((ag for ag in agents if ag.shortIdentifier == agent), None)
|
||||||
if match_agent:
|
if match_agent:
|
||||||
params['agent'] = match_agent.identifier
|
params['agent'] = match_agent.identifier
|
||||||
else:
|
else:
|
||||||
raise NotFound('Couldnt find "%s" in agents list (%s)' %
|
raise NotFound('Couldnt find "%s" in agents list (%s)' %
|
||||||
(agent, ','.join(agents.keys())))
|
(agent, ', '.join([a.shortIdentifier for a in agents])))
|
||||||
else:
|
else:
|
||||||
params['agent'] = self.section().agent
|
params['agent'] = self.section().agent
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue