From 87416001d75062cc4374b3208ed836a2304a26f3 Mon Sep 17 00:00:00 2001 From: desileR <39315068+zeroquinc@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:53:17 +0200 Subject: [PATCH] Add PlayMethod variable As requested in https://github.com/jellyfin/jellyfin-plugin-webhook/issues/183 To see if the user is transcoding or not. Returns either "Transcode", "Direct Stream" or "Direct Play". --- Jellyfin.Plugin.Webhook/Helpers/DataObjectHelpers.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Jellyfin.Plugin.Webhook/Helpers/DataObjectHelpers.cs b/Jellyfin.Plugin.Webhook/Helpers/DataObjectHelpers.cs index 57c3e5b..9fca255 100644 --- a/Jellyfin.Plugin.Webhook/Helpers/DataObjectHelpers.cs +++ b/Jellyfin.Plugin.Webhook/Helpers/DataObjectHelpers.cs @@ -273,6 +273,11 @@ public static Dictionary AddPlaybackProgressData(this Dictionary dataObject[nameof(playbackProgressEventArgs.DeviceName)] = playbackProgressEventArgs.DeviceName; dataObject[nameof(playbackProgressEventArgs.ClientName)] = playbackProgressEventArgs.ClientName; + if (playbackProgressEventArgs.Session is not null && playbackProgressEventArgs.Session.PlayState?.PlayMethod is not null) + { + dataObject["PlayMethod"] = playbackProgressEventArgs.Session.PlayState.PlayMethod; + } + return dataObject; }