aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Data
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2020-05-13 15:03:35 -0400
committerPatrick Barron <barronpm@gmail.com>2020-05-13 15:03:35 -0400
commit511d20a100398baca38f24adfabc56f6f3cfac9c (patch)
treea9f513058e4856672ffff6e0fa6e50a01e6152e1 /Jellyfin.Data
parentbac4bf96a0e642f80f35bd6cdf3de17a9302b6c6 (diff)
Apply review suggestions
Diffstat (limited to 'Jellyfin.Data')
-rw-r--r--Jellyfin.Data/Entities/ActivityLog.cs47
1 files changed, 22 insertions, 25 deletions
diff --git a/Jellyfin.Data/Entities/ActivityLog.cs b/Jellyfin.Data/Entities/ActivityLog.cs
index 633838991..df3026a77 100644
--- a/Jellyfin.Data/Entities/ActivityLog.cs
+++ b/Jellyfin.Data/Entities/ActivityLog.cs
@@ -1,15 +1,10 @@
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
+using Microsoft.Extensions.Logging;
namespace Jellyfin.Data.Entities
{
- [Table("ActivityLog")]
public partial class ActivityLog
{
partial void Init();
@@ -35,23 +30,26 @@ namespace Jellyfin.Data.Entities
/// </summary>
/// <param name="name"></param>
/// <param name="type"></param>
- /// <param name="userid"></param>
+ /// <param name="userId"></param>
/// <param name="datecreated"></param>
- /// <param name="logseverity"></param>
- public ActivityLog(string name, string type, Guid userid, DateTime datecreated, Microsoft.Extensions.Logging.LogLevel logseverity)
+ /// <param name="logSeverity"></param>
+ public ActivityLog(string name, string type, Guid userId)
{
- if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
- this.Name = name;
-
- if (string.IsNullOrEmpty(type)) throw new ArgumentNullException(nameof(type));
- this.Type = type;
-
- this.UserId = userid;
+ if (string.IsNullOrEmpty(name))
+ {
+ throw new ArgumentNullException(nameof(name));
+ }
- this.DateCreated = datecreated;
-
- this.LogSeverity = logseverity;
+ if (string.IsNullOrEmpty(type))
+ {
+ throw new ArgumentNullException(nameof(type));
+ }
+ this.Name = name;
+ this.Type = type;
+ this.UserId = userId;
+ this.DateCreated = DateTime.UtcNow;
+ this.LogSeverity = LogLevel.Trace;
Init();
}
@@ -61,12 +59,12 @@ namespace Jellyfin.Data.Entities
/// </summary>
/// <param name="name"></param>
/// <param name="type"></param>
- /// <param name="userid"></param>
+ /// <param name="userId"></param>
/// <param name="datecreated"></param>
/// <param name="logseverity"></param>
- public static ActivityLog Create(string name, string type, Guid userid, DateTime datecreated, Microsoft.Extensions.Logging.LogLevel logseverity)
+ public static ActivityLog Create(string name, string type, Guid userId)
{
- return new ActivityLog(name, type, userid, datecreated, logseverity);
+ return new ActivityLog(name, type, userId);
}
/*************************************************************************
@@ -134,10 +132,10 @@ namespace Jellyfin.Data.Entities
/// Required
/// </summary>
[Required]
- public Microsoft.Extensions.Logging.LogLevel LogSeverity { get; set; }
+ public LogLevel LogSeverity { get; set; }
/// <summary>
- /// Required, ConcurrenyToken
+ /// Required, ConcurrencyToken.
/// </summary>
[ConcurrencyCheck]
[Required]
@@ -147,7 +145,6 @@ namespace Jellyfin.Data.Entities
{
RowVersion++;
}
-
}
}