From 5de8c249a060dc9a923c42aa544313713ce6d8ed Mon Sep 17 00:00:00 2001 From: crobibero Date: Mon, 23 Nov 2020 08:18:07 -0700 Subject: [PATCH] Don't send activity event if notification type is null --- .../Events/Consumers/Session/PlaybackStopLogger.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStopLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStopLogger.cs index 51a882c143..a0bad29e9b 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStopLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStopLogger.cs @@ -59,6 +59,12 @@ namespace Jellyfin.Server.Implementations.Events.Consumers.Session var user = eventArgs.Users[0]; + var notificationType = GetPlaybackStoppedNotificationType(item.MediaType); + if (notificationType == null) + { + return; + } + await _activityManager.CreateAsync(new ActivityLog( string.Format( CultureInfo.InvariantCulture, @@ -66,7 +72,7 @@ namespace Jellyfin.Server.Implementations.Events.Consumers.Session user.Username, GetItemName(item), eventArgs.DeviceName), - GetPlaybackStoppedNotificationType(item.MediaType), + notificationType, user.Id)) .ConfigureAwait(false); }