diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-12-12 14:40:54 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-12 14:40:54 -0500 |
| commit | acf71527b52bea3d986d5bb3a899b4d8d5c6e2ac (patch) | |
| tree | e6b39da5709b9b2fad03370c69181137f3141d0f /Emby.Server.Implementations/Security | |
| parent | 73e7f20823ed0d18f90c5848791422e83d603f5c (diff) | |
| parent | d84bb7160f8c3cfc953cdece890264d70e504e39 (diff) | |
Merge pull request #2339 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/Security')
| -rw-r--r-- | Emby.Server.Implementations/Security/AuthenticationRepository.cs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/Security/AuthenticationRepository.cs b/Emby.Server.Implementations/Security/AuthenticationRepository.cs index a136701da..392db6935 100644 --- a/Emby.Server.Implementations/Security/AuthenticationRepository.cs +++ b/Emby.Server.Implementations/Security/AuthenticationRepository.cs @@ -201,12 +201,13 @@ namespace Emby.Server.Implementations.Security } var list = new List<AuthenticationInfo>(); - int totalRecordCount = 0; using (WriteLock.Read()) { using (var connection = CreateConnection(true)) { + var result = new QueryResult<AuthenticationInfo>(); + connection.RunInTransaction(db => { var statementTexts = new List<string>(); @@ -229,7 +230,7 @@ namespace Emby.Server.Implementations.Security { BindAuthenticationQueryParams(query, totalCountStatement); - totalRecordCount = totalCountStatement.ExecuteQuery() + result.TotalRecordCount = totalCountStatement.ExecuteQuery() .SelectScalarInt() .First(); } @@ -237,11 +238,8 @@ namespace Emby.Server.Implementations.Security }, ReadTransactionMode); - return new QueryResult<AuthenticationInfo>() - { - Items = list.ToArray(), - TotalRecordCount = totalRecordCount - }; + result.Items = list.ToArray(); + return result; } } } |
