|
@@ -1,4 +1,4 @@
|
|
|
-#pragma warning disable CS1591
|
|
|
+#pragma warning disable CA2227
|
|
|
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
@@ -15,7 +15,7 @@ namespace Jellyfin.Data.Entities
|
|
|
/// <summary>
|
|
|
/// An entity representing a user.
|
|
|
/// </summary>
|
|
|
- public partial class User : IHasPermissions, IHasConcurrencyToken
|
|
|
+ public class User : IHasPermissions, IHasConcurrencyToken
|
|
|
{
|
|
|
/// <summary>
|
|
|
/// The values being delimited here are Guids, so commas work as they do not appear in Guids.
|
|
@@ -75,7 +75,6 @@ namespace Jellyfin.Data.Entities
|
|
|
|
|
|
AddDefaultPermissions();
|
|
|
AddDefaultPreferences();
|
|
|
- Init();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -84,21 +83,14 @@ namespace Jellyfin.Data.Entities
|
|
|
/// </summary>
|
|
|
protected User()
|
|
|
{
|
|
|
- Init();
|
|
|
}
|
|
|
|
|
|
- /*************************************************************************
|
|
|
- * Properties
|
|
|
- *************************************************************************/
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// Gets or sets the Id of the user.
|
|
|
/// </summary>
|
|
|
/// <remarks>
|
|
|
/// Identity, Indexed, Required.
|
|
|
/// </remarks>
|
|
|
- [Key]
|
|
|
- [Required]
|
|
|
[JsonIgnore]
|
|
|
public Guid Id { get; set; }
|
|
|
|
|
@@ -139,7 +131,6 @@ namespace Jellyfin.Data.Entities
|
|
|
/// <remarks>
|
|
|
/// Required.
|
|
|
/// </remarks>
|
|
|
- [Required]
|
|
|
public bool MustUpdatePassword { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
@@ -180,7 +171,6 @@ namespace Jellyfin.Data.Entities
|
|
|
/// <remarks>
|
|
|
/// Required.
|
|
|
/// </remarks>
|
|
|
- [Required]
|
|
|
public int InvalidLoginAttemptCount { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
@@ -204,7 +194,6 @@ namespace Jellyfin.Data.Entities
|
|
|
/// <remarks>
|
|
|
/// Required.
|
|
|
/// </remarks>
|
|
|
- [Required]
|
|
|
public SubtitlePlaybackMode SubtitleMode { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
@@ -213,7 +202,6 @@ namespace Jellyfin.Data.Entities
|
|
|
/// <remarks>
|
|
|
/// Required.
|
|
|
/// </remarks>
|
|
|
- [Required]
|
|
|
public bool PlayDefaultAudioTrack { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
@@ -232,7 +220,6 @@ namespace Jellyfin.Data.Entities
|
|
|
/// <remarks>
|
|
|
/// Required.
|
|
|
/// </remarks>
|
|
|
- [Required]
|
|
|
public bool DisplayMissingEpisodes { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
@@ -241,7 +228,6 @@ namespace Jellyfin.Data.Entities
|
|
|
/// <remarks>
|
|
|
/// Required.
|
|
|
/// </remarks>
|
|
|
- [Required]
|
|
|
public bool DisplayCollectionsView { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
@@ -250,7 +236,6 @@ namespace Jellyfin.Data.Entities
|
|
|
/// <remarks>
|
|
|
/// Required.
|
|
|
/// </remarks>
|
|
|
- [Required]
|
|
|
public bool EnableLocalPassword { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
@@ -259,7 +244,6 @@ namespace Jellyfin.Data.Entities
|
|
|
/// <remarks>
|
|
|
/// Required.
|
|
|
/// </remarks>
|
|
|
- [Required]
|
|
|
public bool HidePlayedInLatest { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
@@ -268,7 +252,6 @@ namespace Jellyfin.Data.Entities
|
|
|
/// <remarks>
|
|
|
/// Required.
|
|
|
/// </remarks>
|
|
|
- [Required]
|
|
|
public bool RememberAudioSelections { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
@@ -277,7 +260,6 @@ namespace Jellyfin.Data.Entities
|
|
|
/// <remarks>
|
|
|
/// Required.
|
|
|
/// </remarks>
|
|
|
- [Required]
|
|
|
public bool RememberSubtitleSelections { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
@@ -286,7 +268,6 @@ namespace Jellyfin.Data.Entities
|
|
|
/// <remarks>
|
|
|
/// Required.
|
|
|
/// </remarks>
|
|
|
- [Required]
|
|
|
public bool EnableNextEpisodeAutoPlay { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
@@ -295,7 +276,6 @@ namespace Jellyfin.Data.Entities
|
|
|
/// <remarks>
|
|
|
/// Required.
|
|
|
/// </remarks>
|
|
|
- [Required]
|
|
|
public bool EnableAutoLogin { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
@@ -304,7 +284,6 @@ namespace Jellyfin.Data.Entities
|
|
|
/// <remarks>
|
|
|
/// Required.
|
|
|
/// </remarks>
|
|
|
- [Required]
|
|
|
public bool EnableUserPreferenceAccess { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
@@ -322,7 +301,6 @@ namespace Jellyfin.Data.Entities
|
|
|
/// This is a temporary stopgap for until the library db is migrated.
|
|
|
/// This corresponds to the value of the index of this user in the library db.
|
|
|
/// </summary>
|
|
|
- [Required]
|
|
|
public long InternalId { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
@@ -340,7 +318,9 @@ namespace Jellyfin.Data.Entities
|
|
|
[Required]
|
|
|
public virtual DisplayPreferences DisplayPreferences { get; set; }
|
|
|
|
|
|
- [Required]
|
|
|
+ /// <summary>
|
|
|
+ /// Gets or sets the level of sync play permissions this user has.
|
|
|
+ /// </summary>
|
|
|
public SyncPlayAccess SyncPlayAccess { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
@@ -350,13 +330,8 @@ namespace Jellyfin.Data.Entities
|
|
|
/// Required, Concurrency Token.
|
|
|
/// </remarks>
|
|
|
[ConcurrencyCheck]
|
|
|
- [Required]
|
|
|
public uint RowVersion { get; set; }
|
|
|
|
|
|
- /*************************************************************************
|
|
|
- * Navigation properties
|
|
|
- *************************************************************************/
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// Gets or sets the list of access schedules this user has.
|
|
|
/// </summary>
|
|
@@ -395,18 +370,6 @@ namespace Jellyfin.Data.Entities
|
|
|
[ForeignKey("Preference_Preferences_Guid")]
|
|
|
public virtual ICollection<Preference> Preferences { get; protected set; }
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// Static create function (for use in LINQ queries, etc.)
|
|
|
- /// </summary>
|
|
|
- /// <param name="username">The username for the created user.</param>
|
|
|
- /// <param name="authenticationProviderId">The Id of the user's authentication provider.</param>
|
|
|
- /// <param name="passwordResetProviderId">The Id of the user's password reset provider.</param>
|
|
|
- /// <returns>The created instance.</returns>
|
|
|
- public static User Create(string username, string authenticationProviderId, string passwordResetProviderId)
|
|
|
- {
|
|
|
- return new User(username, authenticationProviderId, passwordResetProviderId);
|
|
|
- }
|
|
|
-
|
|
|
/// <inheritdoc/>
|
|
|
public void OnSavingChanges()
|
|
|
{
|
|
@@ -519,7 +482,5 @@ namespace Jellyfin.Data.Entities
|
|
|
Preferences.Add(new Preference(val, string.Empty));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- partial void Init();
|
|
|
}
|
|
|
}
|