aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Data/Entities/ActivityLog.cs
diff options
context:
space:
mode:
authorferferga <ferferga.fer@gmail.com>2020-10-19 17:28:07 +0200
committerferferga <ferferga.fer@gmail.com>2020-10-19 17:28:07 +0200
commit9fd01fade6ac971ba72a2e7dd54e2295f23839bc (patch)
tree20a5ff4a1621e765fc93c0e53b149edb61ff3654 /Jellyfin.Data/Entities/ActivityLog.cs
parentba03ed65fe64b724b3e8b5b94b9cbe1075c61da2 (diff)
parent49ac4c4044b1777dc3a25544aead7b0b15b953e8 (diff)
Remove "download images in advance" option
Diffstat (limited to 'Jellyfin.Data/Entities/ActivityLog.cs')
-rw-r--r--Jellyfin.Data/Entities/ActivityLog.cs77
1 files changed, 32 insertions, 45 deletions
diff --git a/Jellyfin.Data/Entities/ActivityLog.cs b/Jellyfin.Data/Entities/ActivityLog.cs
index 522c20664..620e82830 100644
--- a/Jellyfin.Data/Entities/ActivityLog.cs
+++ b/Jellyfin.Data/Entities/ActivityLog.cs
@@ -1,6 +1,7 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Jellyfin.Data.Interfaces;
using Microsoft.Extensions.Logging;
namespace Jellyfin.Data.Entities
@@ -8,7 +9,7 @@ namespace Jellyfin.Data.Entities
/// <summary>
/// An entity referencing an activity log entry.
/// </summary>
- public partial class ActivityLog : ISavingChanges
+ public class ActivityLog : IHasConcurrencyToken
{
/// <summary>
/// Initializes a new instance of the <see cref="ActivityLog"/> class.
@@ -29,13 +30,11 @@ namespace Jellyfin.Data.Entities
throw new ArgumentNullException(nameof(type));
}
- this.Name = name;
- this.Type = type;
- this.UserId = userId;
- this.DateCreated = DateTime.UtcNow;
- this.LogSeverity = LogLevel.Trace;
-
- Init();
+ Name = name;
+ Type = type;
+ UserId = userId;
+ DateCreated = DateTime.UtcNow;
+ LogSeverity = LogLevel.Trace;
}
/// <summary>
@@ -44,38 +43,21 @@ namespace Jellyfin.Data.Entities
/// </summary>
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>
/// Gets or sets the identity of this instance.
/// This is the key in the backing database.
/// </summary>
- [Key]
- [Required]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; protected set; }
/// <summary>
/// Gets or sets the name.
- /// Required, Max length = 512.
/// </summary>
+ /// <remarks>
+ /// Required, Max length = 512.
+ /// </remarks>
[Required]
[MaxLength(512)]
[StringLength(512)]
@@ -83,24 +65,30 @@ namespace Jellyfin.Data.Entities
/// <summary>
/// Gets or sets the overview.
- /// Max length = 512.
/// </summary>
+ /// <remarks>
+ /// Max length = 512.
+ /// </remarks>
[MaxLength(512)]
[StringLength(512)]
public string Overview { get; set; }
/// <summary>
/// Gets or sets the short overview.
- /// Max length = 512.
/// </summary>
+ /// <remarks>
+ /// Max length = 512.
+ /// </remarks>
[MaxLength(512)]
[StringLength(512)]
public string ShortOverview { get; set; }
/// <summary>
/// Gets or sets the type.
- /// Required, Max length = 256.
/// </summary>
+ /// <remarks>
+ /// Required, Max length = 256.
+ /// </remarks>
[Required]
[MaxLength(256)]
[StringLength(256)]
@@ -108,43 +96,42 @@ namespace Jellyfin.Data.Entities
/// <summary>
/// Gets or sets the user id.
- /// Required.
/// </summary>
- [Required]
+ /// <remarks>
+ /// Required.
+ /// </remarks>
public Guid UserId { get; set; }
/// <summary>
/// Gets or sets the item id.
- /// Max length = 256.
/// </summary>
+ /// <remarks>
+ /// Max length = 256.
+ /// </remarks>
[MaxLength(256)]
[StringLength(256)]
public string ItemId { get; set; }
/// <summary>
/// Gets or sets the date created. This should be in UTC.
- /// Required.
/// </summary>
- [Required]
+ /// <remarks>
+ /// Required.
+ /// </remarks>
public DateTime DateCreated { get; set; }
/// <summary>
/// Gets or sets the log severity. Default is <see cref="LogLevel.Trace"/>.
- /// Required.
/// </summary>
- [Required]
+ /// <remarks>
+ /// Required.
+ /// </remarks>
public LogLevel LogSeverity { get; set; }
- /// <summary>
- /// Gets or sets the row version.
- /// Required, ConcurrencyToken.
- /// </summary>
+ /// <inheritdoc />
[ConcurrencyCheck]
- [Required]
public uint RowVersion { get; set; }
- partial void Init();
-
/// <inheritdoc />
public void OnSavingChanges()
{