mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 14:08:44 -04:00
Clean up ActivityLog.cs
This commit is contained in:
parent
732ec7a462
commit
b24221b40f
1 changed files with 31 additions and 47 deletions
|
@ -1,5 +1,3 @@
|
||||||
#pragma warning disable CS1591
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
@ -11,7 +9,7 @@ namespace Jellyfin.Data.Entities
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An entity referencing an activity log entry.
|
/// An entity referencing an activity log entry.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class ActivityLog : IHasConcurrencyToken
|
public class ActivityLog : IHasConcurrencyToken
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ActivityLog"/> class.
|
/// Initializes a new instance of the <see cref="ActivityLog"/> class.
|
||||||
|
@ -32,13 +30,11 @@ namespace Jellyfin.Data.Entities
|
||||||
throw new ArgumentNullException(nameof(type));
|
throw new ArgumentNullException(nameof(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Name = name;
|
Name = name;
|
||||||
this.Type = type;
|
Type = type;
|
||||||
this.UserId = userId;
|
UserId = userId;
|
||||||
this.DateCreated = DateTime.UtcNow;
|
DateCreated = DateTime.UtcNow;
|
||||||
this.LogSeverity = LogLevel.Trace;
|
LogSeverity = LogLevel.Trace;
|
||||||
|
|
||||||
Init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -47,38 +43,21 @@ namespace Jellyfin.Data.Entities
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected ActivityLog()
|
protected ActivityLog()
|
||||||
{
|
{
|
||||||
Init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Static create function (for use in LINQ queries, etc.)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="name">The name.</param>
|
|
||||||
/// <param name="type">The type.</param>
|
|
||||||
/// <param name="userId">The user's id.</param>
|
|
||||||
/// <returns>The new <see cref="ActivityLog"/> instance.</returns>
|
|
||||||
public static ActivityLog Create(string name, string type, Guid userId)
|
|
||||||
{
|
|
||||||
return new ActivityLog(name, type, userId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
* Properties
|
|
||||||
*************************************************************************/
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the identity of this instance.
|
/// Gets or sets the identity of this instance.
|
||||||
/// This is the key in the backing database.
|
/// This is the key in the backing database.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Key]
|
|
||||||
[Required]
|
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public int Id { get; protected set; }
|
public int Id { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the name.
|
/// Gets or sets the name.
|
||||||
/// Required, Max length = 512.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Required, Max length = 512.
|
||||||
|
/// </remarks>
|
||||||
[Required]
|
[Required]
|
||||||
[MaxLength(512)]
|
[MaxLength(512)]
|
||||||
[StringLength(512)]
|
[StringLength(512)]
|
||||||
|
@ -86,24 +65,30 @@ namespace Jellyfin.Data.Entities
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the overview.
|
/// Gets or sets the overview.
|
||||||
/// Max length = 512.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Max length = 512.
|
||||||
|
/// </remarks>
|
||||||
[MaxLength(512)]
|
[MaxLength(512)]
|
||||||
[StringLength(512)]
|
[StringLength(512)]
|
||||||
public string Overview { get; set; }
|
public string Overview { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the short overview.
|
/// Gets or sets the short overview.
|
||||||
/// Max length = 512.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Max length = 512.
|
||||||
|
/// </remarks>
|
||||||
[MaxLength(512)]
|
[MaxLength(512)]
|
||||||
[StringLength(512)]
|
[StringLength(512)]
|
||||||
public string ShortOverview { get; set; }
|
public string ShortOverview { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the type.
|
/// Gets or sets the type.
|
||||||
/// Required, Max length = 256.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Required, Max length = 256.
|
||||||
|
/// </remarks>
|
||||||
[Required]
|
[Required]
|
||||||
[MaxLength(256)]
|
[MaxLength(256)]
|
||||||
[StringLength(256)]
|
[StringLength(256)]
|
||||||
|
@ -111,43 +96,42 @@ namespace Jellyfin.Data.Entities
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the user id.
|
/// Gets or sets the user id.
|
||||||
/// Required.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
/// <remarks>
|
||||||
|
/// Required.
|
||||||
|
/// </remarks>
|
||||||
public Guid UserId { get; set; }
|
public Guid UserId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the item id.
|
/// Gets or sets the item id.
|
||||||
/// Max length = 256.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Max length = 256.
|
||||||
|
/// </remarks>
|
||||||
[MaxLength(256)]
|
[MaxLength(256)]
|
||||||
[StringLength(256)]
|
[StringLength(256)]
|
||||||
public string ItemId { get; set; }
|
public string ItemId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the date created. This should be in UTC.
|
/// Gets or sets the date created. This should be in UTC.
|
||||||
/// Required.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
/// <remarks>
|
||||||
|
/// Required.
|
||||||
|
/// </remarks>
|
||||||
public DateTime DateCreated { get; set; }
|
public DateTime DateCreated { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the log severity. Default is <see cref="LogLevel.Trace"/>.
|
/// Gets or sets the log severity. Default is <see cref="LogLevel.Trace"/>.
|
||||||
/// Required.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
/// <remarks>
|
||||||
|
/// Required.
|
||||||
|
/// </remarks>
|
||||||
public LogLevel LogSeverity { get; set; }
|
public LogLevel LogSeverity { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc />
|
||||||
/// Gets or sets the row version.
|
|
||||||
/// Required, ConcurrencyToken.
|
|
||||||
/// </summary>
|
|
||||||
[ConcurrencyCheck]
|
[ConcurrencyCheck]
|
||||||
[Required]
|
|
||||||
public uint RowVersion { get; set; }
|
public uint RowVersion { get; set; }
|
||||||
|
|
||||||
partial void Init();
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void OnSavingChanges()
|
public void OnSavingChanges()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue