diff options
Diffstat (limited to 'Emby.Server.Implementations/Security/AuthenticationRepository.cs')
| -rw-r--r-- | Emby.Server.Implementations/Security/AuthenticationRepository.cs | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/Emby.Server.Implementations/Security/AuthenticationRepository.cs b/Emby.Server.Implementations/Security/AuthenticationRepository.cs index 228d511ce..c81a93767 100644 --- a/Emby.Server.Implementations/Security/AuthenticationRepository.cs +++ b/Emby.Server.Implementations/Security/AuthenticationRepository.cs @@ -1,18 +1,15 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; -using System.Threading; using Emby.Server.Implementations.Data; -using MediaBrowser.Controller; +using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Security; -using Microsoft.Extensions.Logging; +using MediaBrowser.Model.Devices; using MediaBrowser.Model.Querying; +using Microsoft.Extensions.Logging; using SQLitePCL.pretty; -using MediaBrowser.Model.Extensions; -using MediaBrowser.Controller.Configuration; -using MediaBrowser.Model.Devices; namespace Emby.Server.Implementations.Security { @@ -21,8 +18,8 @@ namespace Emby.Server.Implementations.Security private readonly IServerConfigurationManager _config; private readonly CultureInfo _usCulture = new CultureInfo("en-US"); - public AuthenticationRepository(ILogger logger, IServerConfigurationManager config) - : base(logger) + public AuthenticationRepository(ILoggerFactory loggerFactory, IServerConfigurationManager config) + : base(loggerFactory.CreateLogger(nameof(AuthenticationRepository))) { _config = config; DbFilePath = Path.Combine(config.ApplicationPaths.DataPath, "authentication.db"); @@ -91,7 +88,7 @@ namespace Emby.Server.Implementations.Security { if (info == null) { - throw new ArgumentNullException("info"); + throw new ArgumentNullException(nameof(info)); } using (WriteLock.Write()) @@ -126,7 +123,7 @@ namespace Emby.Server.Implementations.Security { if (info == null) { - throw new ArgumentNullException("entry"); + throw new ArgumentNullException(nameof(info)); } using (WriteLock.Write()) @@ -161,7 +158,7 @@ namespace Emby.Server.Implementations.Security { if (info == null) { - throw new ArgumentNullException("entry"); + throw new ArgumentNullException(nameof(info)); } using (WriteLock.Write()) @@ -183,7 +180,7 @@ namespace Emby.Server.Implementations.Security private const string BaseSelectText = "select Tokens.Id, AccessToken, DeviceId, AppName, AppVersion, DeviceName, UserId, UserName, DateCreated, DateLastActivity, Devices.CustomName from Tokens left join Devices on Tokens.DeviceId=Devices.Id"; - private void BindAuthenticationQueryParams(AuthenticationInfoQuery query, IStatement statement) + private static void BindAuthenticationQueryParams(AuthenticationInfoQuery query, IStatement statement) { if (!string.IsNullOrEmpty(query.AccessToken)) { @@ -205,7 +202,7 @@ namespace Emby.Server.Implementations.Security { if (query == null) { - throw new ArgumentNullException("query"); + throw new ArgumentNullException(nameof(query)); } var commandText = BaseSelectText; @@ -306,7 +303,7 @@ namespace Emby.Server.Implementations.Security } } - private AuthenticationInfo Get(IReadOnlyList<IResultSetValue> reader) + private static AuthenticationInfo Get(IReadOnlyList<IResultSetValue> reader) { var info = new AuthenticationInfo { @@ -397,7 +394,7 @@ namespace Emby.Server.Implementations.Security { if (options == null) { - throw new ArgumentNullException("options"); + throw new ArgumentNullException(nameof(options)); } using (WriteLock.Write()) |
