diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-12-12 03:53:25 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-12-12 03:53:25 -0500 |
| commit | c2d0fd99852aae31379b89591b538d075743362f (patch) | |
| tree | bfd9cfd47667bdf35668a9751cc82a56ac609282 /Emby.Server.Implementations/Security/AuthenticationRepository.cs | |
| parent | 1aff48b93b72fe7d418b4798f504bd0d145f44e8 (diff) | |
update season queries
Diffstat (limited to 'Emby.Server.Implementations/Security/AuthenticationRepository.cs')
| -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; } } } |
