diff --git a/Jellyfin.Data/Entities/User.cs b/Jellyfin.Data/Entities/User.cs index 7ea1f44986..765beaff3d 100644 --- a/Jellyfin.Data/Entities/User.cs +++ b/Jellyfin.Data/Entities/User.cs @@ -1,5 +1,3 @@ -#pragma warning disable CS1591 - using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -15,7 +13,7 @@ namespace Jellyfin.Data.Entities /// /// An entity representing a user. /// - public partial class User : IHasPermissions, IHasConcurrencyToken + public class User : IHasPermissions, IHasConcurrencyToken { /// /// The values being delimited here are Guids, so commas work as they do not appear in Guids. @@ -75,7 +73,6 @@ namespace Jellyfin.Data.Entities AddDefaultPermissions(); AddDefaultPreferences(); - Init(); } /// @@ -84,21 +81,14 @@ namespace Jellyfin.Data.Entities /// protected User() { - Init(); } - /************************************************************************* - * Properties - *************************************************************************/ - /// /// Gets or sets the Id of the user. /// /// /// Identity, Indexed, Required. /// - [Key] - [Required] [JsonIgnore] public Guid Id { get; set; } @@ -139,7 +129,6 @@ namespace Jellyfin.Data.Entities /// /// Required. /// - [Required] public bool MustUpdatePassword { get; set; } /// @@ -180,7 +169,6 @@ namespace Jellyfin.Data.Entities /// /// Required. /// - [Required] public int InvalidLoginAttemptCount { get; set; } /// @@ -204,7 +192,6 @@ namespace Jellyfin.Data.Entities /// /// Required. /// - [Required] public SubtitlePlaybackMode SubtitleMode { get; set; } /// @@ -213,7 +200,6 @@ namespace Jellyfin.Data.Entities /// /// Required. /// - [Required] public bool PlayDefaultAudioTrack { get; set; } /// @@ -232,7 +218,6 @@ namespace Jellyfin.Data.Entities /// /// Required. /// - [Required] public bool DisplayMissingEpisodes { get; set; } /// @@ -241,7 +226,6 @@ namespace Jellyfin.Data.Entities /// /// Required. /// - [Required] public bool DisplayCollectionsView { get; set; } /// @@ -250,7 +234,6 @@ namespace Jellyfin.Data.Entities /// /// Required. /// - [Required] public bool EnableLocalPassword { get; set; } /// @@ -259,7 +242,6 @@ namespace Jellyfin.Data.Entities /// /// Required. /// - [Required] public bool HidePlayedInLatest { get; set; } /// @@ -268,7 +250,6 @@ namespace Jellyfin.Data.Entities /// /// Required. /// - [Required] public bool RememberAudioSelections { get; set; } /// @@ -277,7 +258,6 @@ namespace Jellyfin.Data.Entities /// /// Required. /// - [Required] public bool RememberSubtitleSelections { get; set; } /// @@ -286,7 +266,6 @@ namespace Jellyfin.Data.Entities /// /// Required. /// - [Required] public bool EnableNextEpisodeAutoPlay { get; set; } /// @@ -295,7 +274,6 @@ namespace Jellyfin.Data.Entities /// /// Required. /// - [Required] public bool EnableAutoLogin { get; set; } /// @@ -304,7 +282,6 @@ namespace Jellyfin.Data.Entities /// /// Required. /// - [Required] public bool EnableUserPreferenceAccess { get; set; } /// @@ -322,7 +299,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. /// - [Required] public long InternalId { get; set; } /// @@ -340,7 +316,9 @@ namespace Jellyfin.Data.Entities [Required] public virtual DisplayPreferences DisplayPreferences { get; set; } - [Required] + /// + /// Gets or sets the level of sync play permissions this user has. + /// public SyncPlayAccess SyncPlayAccess { get; set; } /// @@ -350,13 +328,8 @@ namespace Jellyfin.Data.Entities /// Required, Concurrency Token. /// [ConcurrencyCheck] - [Required] public uint RowVersion { get; set; } - /************************************************************************* - * Navigation properties - *************************************************************************/ - /// /// Gets or sets the list of access schedules this user has. /// @@ -395,18 +368,6 @@ namespace Jellyfin.Data.Entities [ForeignKey("Preference_Preferences_Guid")] public virtual ICollection Preferences { get; protected set; } - /// - /// Static create function (for use in LINQ queries, etc.) - /// - /// The username for the created user. - /// The Id of the user's authentication provider. - /// The Id of the user's password reset provider. - /// The created instance. - public static User Create(string username, string authenticationProviderId, string passwordResetProviderId) - { - return new User(username, authenticationProviderId, passwordResetProviderId); - } - /// public void OnSavingChanges() { @@ -519,7 +480,5 @@ namespace Jellyfin.Data.Entities Preferences.Add(new Preference(val, string.Empty)); } } - - partial void Init(); } }