diff options
Diffstat (limited to 'MediaBrowser.Controller/Entities/User.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/User.cs | 80 |
1 files changed, 20 insertions, 60 deletions
diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs index f569c8021..10fe096a4 100644 --- a/MediaBrowser.Controller/Entities/User.cs +++ b/MediaBrowser.Controller/Entities/User.cs @@ -1,12 +1,12 @@ -using MediaBrowser.Controller.Library; +using System; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Connect; using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Users; -using System; -using System.Threading; -using System.Threading.Tasks; namespace MediaBrowser.Controller.Entities { @@ -19,7 +19,7 @@ namespace MediaBrowser.Controller.Entities public static IXmlSerializer XmlSerializer { get; set; } /// <summary> - /// From now on all user paths will be Id-based. + /// From now on all user paths will be Id-based. /// This is for backwards compatibility. /// </summary> public bool UsesIdForConfigurationPath { get; set; } @@ -40,14 +40,8 @@ namespace MediaBrowser.Controller.Entities // Strictly to remove IgnoreDataMember public override ItemImageInfo[] ImageInfos { - get - { - return base.ImageInfos; - } - set - { - base.ImageInfos = value; - } + get => base.ImageInfos; + set => base.ImageInfos = value; } /// <summary> @@ -57,15 +51,8 @@ namespace MediaBrowser.Controller.Entities [IgnoreDataMember] public override string Path { - get - { - // Return this so that metadata providers will look in here - return ConfigurationDirectoryPath; - } - set - { - base.Path = value; - } + get => ConfigurationDirectoryPath; + set => base.Path = value; } private string _name; @@ -75,10 +62,7 @@ namespace MediaBrowser.Controller.Entities /// <value>The name.</value> public override string Name { - get - { - return _name; - } + get => _name; set { _name = value; @@ -94,26 +78,14 @@ namespace MediaBrowser.Controller.Entities /// </summary> /// <value>The containing folder path.</value> [IgnoreDataMember] - public override string ContainingFolderPath - { - get - { - return Path; - } - } + public override string ContainingFolderPath => Path; /// <summary> /// Gets the root folder. /// </summary> /// <value>The root folder.</value> [IgnoreDataMember] - public Folder RootFolder - { - get - { - return LibraryManager.GetUserRootFolder(); - } - } + public Folder RootFolder => LibraryManager.GetUserRootFolder(); /// <summary> /// Gets or sets the last login date. @@ -146,7 +118,7 @@ namespace MediaBrowser.Controller.Entities return _config; } - set { _config = value; } + set => _config = value; } private volatile UserPolicy _policy; @@ -169,7 +141,7 @@ namespace MediaBrowser.Controller.Entities return _policy; } - set { _policy = value; } + set => _policy = value; } /// <summary> @@ -177,12 +149,12 @@ namespace MediaBrowser.Controller.Entities /// </summary> /// <param name="newName">The new name.</param> /// <returns>Task.</returns> - /// <exception cref="System.ArgumentNullException"></exception> + /// <exception cref="ArgumentNullException"></exception> public Task Rename(string newName) { if (string.IsNullOrEmpty(newName)) { - throw new ArgumentNullException("newName"); + throw new ArgumentNullException(nameof(newName)); } // If only the casing is changing, leave the file system alone @@ -232,13 +204,7 @@ namespace MediaBrowser.Controller.Entities /// </summary> /// <value>The configuration directory path.</value> [IgnoreDataMember] - public string ConfigurationDirectoryPath - { - get - { - return GetConfigurationDirectoryPath(Name); - } - } + public string ConfigurationDirectoryPath => GetConfigurationDirectoryPath(Name); public override double GetDefaultPrimaryImageAspectRatio() { @@ -259,7 +225,7 @@ namespace MediaBrowser.Controller.Entities { if (string.IsNullOrEmpty(username)) { - throw new ArgumentNullException("username"); + throw new ArgumentNullException(nameof(username)); } var safeFolderName = FileSystem.GetValidFilename(username); @@ -327,15 +293,9 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsPeople - { - get - { - return false; - } - } + public override bool SupportsPeople => false; - public long InternalId { get; set;} + public long InternalId { get; set; } } |
