mirror of
https://github.com/jellyfin/jellyfin-plugin-webhook.git
synced 2024-11-23 05:59:58 +00:00
10.10 (#296)
This commit is contained in:
parent
3d36010a94
commit
27a2ce9a42
@ -325,16 +325,61 @@ public static class DataObjectHelpers
|
||||
/// <param name="sessionInfo">The session info to add.</param>
|
||||
/// <returns>The modified data object.</returns>
|
||||
public static Dictionary<string, object> AddSessionInfoData(this Dictionary<string, object> dataObject, SessionInfo sessionInfo)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(sessionInfo.Id))
|
||||
{
|
||||
dataObject[nameof(sessionInfo.Id)] = sessionInfo.Id;
|
||||
}
|
||||
|
||||
dataObject[nameof(sessionInfo.UserId)] = sessionInfo.UserId;
|
||||
dataObject["NotificationUsername"] = sessionInfo.UserName.Escape();
|
||||
dataObject[nameof(sessionInfo.Client)] = sessionInfo.Client.Escape();
|
||||
dataObject[nameof(sessionInfo.LastActivityDate)] = sessionInfo.LastActivityDate;
|
||||
dataObject[nameof(sessionInfo.LastPlaybackCheckIn)] = sessionInfo.LastPlaybackCheckIn;
|
||||
dataObject[nameof(sessionInfo.DeviceName)] = sessionInfo.DeviceName.Escape();
|
||||
|
||||
if (!string.IsNullOrEmpty(sessionInfo.DeviceId))
|
||||
{
|
||||
dataObject[nameof(sessionInfo.DeviceId)] = sessionInfo.DeviceId;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(sessionInfo.RemoteEndPoint))
|
||||
{
|
||||
dataObject[nameof(sessionInfo.RemoteEndPoint)] = sessionInfo.RemoteEndPoint;
|
||||
}
|
||||
|
||||
return dataObject;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add session info data.
|
||||
/// </summary>
|
||||
/// <param name="dataObject">The data object.</param>
|
||||
/// <param name="sessionInfo">The session info to add.</param>
|
||||
/// <returns>The modified data object.</returns>
|
||||
public static Dictionary<string, object> AddSessionInfoData(this Dictionary<string, object> dataObject, SessionInfoDto sessionInfo)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(sessionInfo.Id))
|
||||
{
|
||||
dataObject[nameof(sessionInfo.Id)] = sessionInfo.Id;
|
||||
}
|
||||
|
||||
dataObject[nameof(sessionInfo.UserId)] = sessionInfo.UserId;
|
||||
dataObject["NotificationUsername"] = sessionInfo.UserName.Escape();
|
||||
dataObject[nameof(sessionInfo.Client)] = sessionInfo.Client.Escape();
|
||||
dataObject[nameof(sessionInfo.LastActivityDate)] = sessionInfo.LastActivityDate;
|
||||
dataObject[nameof(sessionInfo.LastPlaybackCheckIn)] = sessionInfo.LastPlaybackCheckIn;
|
||||
dataObject[nameof(sessionInfo.DeviceName)] = sessionInfo.DeviceName.Escape();
|
||||
|
||||
if (!string.IsNullOrEmpty(sessionInfo.DeviceId))
|
||||
{
|
||||
dataObject[nameof(sessionInfo.DeviceId)] = sessionInfo.DeviceId;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(sessionInfo.RemoteEndPoint))
|
||||
{
|
||||
dataObject[nameof(sessionInfo.RemoteEndPoint)] = sessionInfo.RemoteEndPoint;
|
||||
}
|
||||
|
||||
return dataObject;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user