Skip to content

Commit

Permalink
Allow getting client by machine identifier (#1418)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyWong16 authored Jun 22, 2024
1 parent dd80deb commit a4e6ec6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plexapi/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,16 +413,17 @@ def clients(self):
return items

def client(self, name):
""" Returns the :class:`~plexapi.client.PlexClient` that matches the specified name.
""" Returns the :class:`~plexapi.client.PlexClient` that matches the specified name
or machine identifier.
Parameters:
name (str): Name of the client to return.
name (str): Name or machine identifier of the client to return.
Raises:
:exc:`~plexapi.exceptions.NotFound`: Unknown client name.
"""
for client in self.clients():
if client and client.title == name:
if client and (client.title == name or client.machineIdentifier == name):
return client

raise NotFound(f'Unknown client name: {name}')
Expand Down

0 comments on commit a4e6ec6

Please sign in to comment.