10.10 (#296)
Some checks failed
🏗️ Build Plugin / call (push) Has been cancelled
📝 Create/Update Release Draft & Release Bump PR / call (push) Has been cancelled
🔬 Run CodeQL / call (push) Has been cancelled
🧪 Test Plugin / call (push) Has been cancelled

This commit is contained in:
Cody Robibero 2024-10-26 12:16:58 -06:00 committed by GitHub
parent 3d36010a94
commit 27a2ce9a42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 51 additions and 6 deletions

View File

@ -326,15 +326,60 @@ public static class DataObjectHelpers
/// <returns>The modified data object.</returns>
public static Dictionary<string, object> AddSessionInfoData(this Dictionary<string, object> dataObject, SessionInfo sessionInfo)
{
dataObject[nameof(sessionInfo.Id)] = sessionInfo.Id;
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();
dataObject[nameof(sessionInfo.DeviceId)] = sessionInfo.DeviceId;
dataObject[nameof(sessionInfo.RemoteEndPoint)] = sessionInfo.RemoteEndPoint;
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;
}

View File

@ -19,4 +19,4 @@ public interface IItemDeletedManager
/// </summary>
/// <param name="item">The deleted item.</param>
public void AddItem(BaseItem item);
}
}

View File

@ -50,4 +50,4 @@ public class ItemDeletedNotifierEntryPoint : IHostedService
_libraryManager.ItemRemoved -= ItemDeletedHandler;
return Task.CompletedTask;
}
}
}

View File

@ -68,4 +68,4 @@ public class ItemDeletedScheduledTask : IScheduledTask, IConfigurableScheduledTa
}
};
}
}
}