diff options
| author | Bond-009 <bond.009@outlook.com> | 2019-12-18 11:53:41 +0100 |
|---|---|---|
| committer | Bond-009 <bond.009@outlook.com> | 2019-12-18 11:53:41 +0100 |
| commit | a1ca50fd5a74eafa6e609976d90cad42b54137e5 (patch) | |
| tree | 9c64d6914c27a8d7e2f8e6f71d7a5952197705cf /MediaBrowser.Api/UserLibrary/ItemsService.cs | |
| parent | 8723bdbb4fb73ed261ac1ba3b6932773e523d78b (diff) | |
| parent | 6b185119aa329764c1ccc57d9be3e81f05680b69 (diff) | |
Merge branch 'namingtests' of https://github.com/Bond-009/jellyfin into namingtests
Diffstat (limited to 'MediaBrowser.Api/UserLibrary/ItemsService.cs')
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/ItemsService.cs | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index b4a302648..c7b505171 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Globalization; using System.Linq; +using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Audio; @@ -58,25 +58,17 @@ namespace MediaBrowser.Api.UserLibrary /// <param name="libraryManager">The library manager.</param> /// <param name="localization">The localization.</param> /// <param name="dtoService">The dto service.</param> - public ItemsService(IUserManager userManager, ILibraryManager libraryManager, ILocalizationManager localization, IDtoService dtoService, IAuthorizationContext authContext) + public ItemsService( + ILogger logger, + IServerConfigurationManager serverConfigurationManager, + IHttpResultFactory httpResultFactory, + IUserManager userManager, + ILibraryManager libraryManager, + ILocalizationManager localization, + IDtoService dtoService, + IAuthorizationContext authContext) + : base(logger, serverConfigurationManager, httpResultFactory) { - if (userManager == null) - { - throw new ArgumentNullException(nameof(userManager)); - } - if (libraryManager == null) - { - throw new ArgumentNullException(nameof(libraryManager)); - } - if (localization == null) - { - throw new ArgumentNullException(nameof(localization)); - } - if (dtoService == null) - { - throw new ArgumentNullException(nameof(dtoService)); - } - _userManager = userManager; _libraryManager = libraryManager; _localization = localization; @@ -127,6 +119,7 @@ namespace MediaBrowser.Api.UserLibrary var result = new QueryResult<BaseItemDto> { + StartIndex = request.StartIndex.GetValueOrDefault(), TotalRecordCount = itemsResult.TotalRecordCount, Items = returnItems }; @@ -177,6 +170,7 @@ namespace MediaBrowser.Api.UserLibrary return new QueryResult<BaseItemDto> { + StartIndex = request.StartIndex.GetValueOrDefault(), TotalRecordCount = result.TotalRecordCount, Items = dtoList }; @@ -237,7 +231,8 @@ namespace MediaBrowser.Api.UserLibrary return new QueryResult<BaseItem> { Items = Array.Empty<BaseItem>(), - TotalRecordCount = 0 + TotalRecordCount = 0, + StartIndex = 0 }; } @@ -250,7 +245,8 @@ namespace MediaBrowser.Api.UserLibrary return new QueryResult<BaseItem> { Items = itemsArray, - TotalRecordCount = itemsArray.Length + TotalRecordCount = itemsArray.Length, + StartIndex = 0 }; } @@ -476,7 +472,7 @@ namespace MediaBrowser.Api.UserLibrary } // Apply default sorting if none requested - if (query.OrderBy.Length == 0) + if (query.OrderBy.Count == 0) { // Albums by artist if (query.ArtistIds.Length > 0 && query.IncludeItemTypes.Length == 1 && string.Equals(query.IncludeItemTypes[0], "MusicAlbum", StringComparison.OrdinalIgnoreCase)) |
