Skip to content

Commit b54f61d

Browse files
committed
only allow sections available agents to be used.
1 parent cea4f19 commit b54f61d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plexapi/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,13 +453,13 @@ def matches(self, auto=False, agent=None, title=None, year=None, language=None):
453453
'year': year or self.year if self.section().type != 'artist' else '',
454454
'language': language or self.section().language}
455455
if agent:
456-
agents = self._server.agents()
456+
agents = self.section().agents()
457457
match_agent = next((ag for ag in agents if ag.shortIdentifier == agent), None)
458458
if match_agent:
459459
params['agent'] = match_agent.identifier
460460
else:
461461
raise NotFound('Couldnt find "%s" in agents list (%s)' %
462-
(agent, ','.join(agents.keys())))
462+
(agent, ', '.join([a.shortIdentifier for a in agents])))
463463
else:
464464
params['agent'] = self.section().agent
465465

0 commit comments

Comments
 (0)