diff --git a/src/Backends/Emby/Action/InspectRequest.php b/src/Backends/Emby/Action/InspectRequest.php index 6d1d1f26..e043e239 100644 --- a/src/Backends/Emby/Action/InspectRequest.php +++ b/src/Backends/Emby/Action/InspectRequest.php @@ -5,8 +5,8 @@ declare(strict_types=1); namespace App\Backends\Emby\Action; use App\Backends\Common\CommonTrait; -use App\Backends\Common\Response; use App\Backends\Common\Context; +use App\Backends\Common\Response; use Psr\Http\Message\ServerRequestInterface; class InspectRequest @@ -27,9 +27,9 @@ class InspectRequest $payload = (string)ag($request->getParsedBody() ?? [], 'data', null); $json = json_decode( - json: $payload, + json: $payload, associative: true, - flags: JSON_INVALID_UTF8_IGNORE | JSON_THROW_ON_ERROR + flags: JSON_INVALID_UTF8_IGNORE | JSON_THROW_ON_ERROR ); $alteredRequest = $request->withParsedBody($json); @@ -38,7 +38,8 @@ class InspectRequest 'ITEM_ID' => ag($json, 'Item.Id', ''), 'SERVER_ID' => ag($json, 'Server.Id', ''), 'SERVER_NAME' => ag($json, 'Server.Name', ''), - 'SERVER_VERSION' => afterLast($userAgent, '/'), + 'SERVER_CLIENT' => before($userAgent, '/'), + 'SERVER_VERSION' => ag($json, 'Server.Version', fn() => afterLast($userAgent, '/')), 'USER_ID' => ag($json, 'User.Id', ''), 'USER_NAME' => ag($json, 'User.Name', ''), 'WH_EVENT' => ag($json, 'Event', 'not_set'), diff --git a/src/Backends/Jellyfin/Action/InspectRequest.php b/src/Backends/Jellyfin/Action/InspectRequest.php index e1ebc561..994c05f8 100644 --- a/src/Backends/Jellyfin/Action/InspectRequest.php +++ b/src/Backends/Jellyfin/Action/InspectRequest.php @@ -5,8 +5,8 @@ declare(strict_types=1); namespace App\Backends\Jellyfin\Action; use App\Backends\Common\CommonTrait; -use App\Backends\Common\Response; use App\Backends\Common\Context; +use App\Backends\Common\Response; use Psr\Http\Message\ServerRequestInterface; final class InspectRequest @@ -38,6 +38,7 @@ final class InspectRequest 'ITEM_ID' => ag($json, 'ItemId', ''), 'SERVER_ID' => ag($json, 'ServerId', ''), 'SERVER_NAME' => ag($json, 'ServerName', ''), + 'SERVER_CLIENT' => before($userAgent, '/'), 'SERVER_VERSION' => ag($json, 'ServerVersion', fn() => afterLast($userAgent, '/')), 'USER_ID' => ag($json, 'UserId', ''), 'USER_NAME' => ag($json, 'NotificationUsername', ''), diff --git a/src/Backends/Plex/Action/InspectRequest.php b/src/Backends/Plex/Action/InspectRequest.php index 3a2dd619..1fd0cbad 100644 --- a/src/Backends/Plex/Action/InspectRequest.php +++ b/src/Backends/Plex/Action/InspectRequest.php @@ -5,8 +5,8 @@ declare(strict_types=1); namespace App\Backends\Plex\Action; use App\Backends\Common\CommonTrait; -use App\Backends\Common\Response; use App\Backends\Common\Context; +use App\Backends\Common\Response; use Psr\Http\Message\ServerRequestInterface; final class InspectRequest @@ -27,9 +27,9 @@ final class InspectRequest $payload = ag($request->getParsedBody() ?? [], 'payload', null); $json = json_decode( - json: $payload, + json: $payload, associative: true, - flags: JSON_INVALID_UTF8_IGNORE | JSON_THROW_ON_ERROR + flags: JSON_INVALID_UTF8_IGNORE | JSON_THROW_ON_ERROR ); $alteredRequest = $request->withParsedBody($json); @@ -38,7 +38,8 @@ final class InspectRequest 'ITEM_ID' => ag($json, 'Metadata.ratingKey', ''), 'SERVER_ID' => ag($json, 'Server.uuid', ''), 'SERVER_NAME' => ag($json, 'Server.title', ''), - 'SERVER_VERSION' => afterLast($userAgent, '/'), + 'SERVER_CLIENT' => before($userAgent, '/'), + 'SERVER_VERSION' => ag($json, 'Server.version', fn() => afterLast($userAgent, '/')), 'USER_ID' => ag($json, 'Account.id', ''), 'USER_NAME' => ag($json, 'Account.title', ''), 'WH_EVENT' => ag($json, 'event', 'not_set'),