|
|
|
@ -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
|
|
|
|
|
/// <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 +73,6 @@ namespace Jellyfin.Data.Entities
|
|
|
|
|
|
|
|
|
|
AddDefaultPermissions();
|
|
|
|
|
AddDefaultPreferences();
|
|
|
|
|
Init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -84,21 +81,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 +129,6 @@ namespace Jellyfin.Data.Entities
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[Required]
|
|
|
|
|
public bool MustUpdatePassword { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -180,7 +169,6 @@ namespace Jellyfin.Data.Entities
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[Required]
|
|
|
|
|
public int InvalidLoginAttemptCount { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -204,7 +192,6 @@ namespace Jellyfin.Data.Entities
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[Required]
|
|
|
|
|
public SubtitlePlaybackMode SubtitleMode { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -213,7 +200,6 @@ namespace Jellyfin.Data.Entities
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[Required]
|
|
|
|
|
public bool PlayDefaultAudioTrack { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -232,7 +218,6 @@ namespace Jellyfin.Data.Entities
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[Required]
|
|
|
|
|
public bool DisplayMissingEpisodes { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -241,7 +226,6 @@ namespace Jellyfin.Data.Entities
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[Required]
|
|
|
|
|
public bool DisplayCollectionsView { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -250,7 +234,6 @@ namespace Jellyfin.Data.Entities
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[Required]
|
|
|
|
|
public bool EnableLocalPassword { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -259,7 +242,6 @@ namespace Jellyfin.Data.Entities
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[Required]
|
|
|
|
|
public bool HidePlayedInLatest { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -268,7 +250,6 @@ namespace Jellyfin.Data.Entities
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[Required]
|
|
|
|
|
public bool RememberAudioSelections { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -277,7 +258,6 @@ namespace Jellyfin.Data.Entities
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[Required]
|
|
|
|
|
public bool RememberSubtitleSelections { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -286,7 +266,6 @@ namespace Jellyfin.Data.Entities
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[Required]
|
|
|
|
|
public bool EnableNextEpisodeAutoPlay { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -295,7 +274,6 @@ namespace Jellyfin.Data.Entities
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[Required]
|
|
|
|
|
public bool EnableAutoLogin { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -304,7 +282,6 @@ namespace Jellyfin.Data.Entities
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[Required]
|
|
|
|
|
public bool EnableUserPreferenceAccess { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -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.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Required]
|
|
|
|
|
public long InternalId { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -340,7 +316,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 +328,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 +368,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 +480,5 @@ namespace Jellyfin.Data.Entities
|
|
|
|
|
Preferences.Add(new Preference(val, string.Empty));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
partial void Init();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|