From 552283eb0bf4b442fed25c934c12f3829247688d Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sat, 18 May 2024 22:03:50 -0700 Subject: [PATCH] Allow getting client by machine identifier --- plexapi/server.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plexapi/server.py b/plexapi/server.py index 178ce82b6..f39a423f1 100644 --- a/plexapi/server.py +++ b/plexapi/server.py @@ -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}')