浏览代码

Merge pull request #4562 from crobibero/playback-stop-notification

Don't send activity event if notification type is null
Bill Thornton 4 年之前
父节点
当前提交
2d415374d6
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStopLogger.cs

+ 7 - 1
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);
         }