From a3af6f2ed891d385494b76fb2d462899dd667907 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 30 Jan 2015 01:32:20 -0500 Subject: [PATCH] support play all from here for episodes --- MediaBrowser.Api/TvShowsService.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Api/TvShowsService.cs b/MediaBrowser.Api/TvShowsService.cs index f72a0a441e..13ec1db3cf 100644 --- a/MediaBrowser.Api/TvShowsService.cs +++ b/MediaBrowser.Api/TvShowsService.cs @@ -156,6 +156,20 @@ namespace MediaBrowser.Api [ApiMember(Name = "AdjacentTo", Description = "Optional. Return items that are siblings of a supplied item.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] public string AdjacentTo { get; set; } + + /// + /// Skips over a given number of items within the results. Use for paging. + /// + /// The start index. + [ApiMember(Name = "StartIndex", Description = "Optional. The record index to start at. All items with a lower index will be dropped from the results.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")] + public int? StartIndex { get; set; } + + /// + /// The maximum number of items to return + /// + /// The limit. + [ApiMember(Name = "Limit", Description = "Optional. The maximum number of records to return", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")] + public int? Limit { get; set; } } [Route("/Shows/{Id}/Seasons", "GET", Summary = "Gets seasons for a tv series")] @@ -471,9 +485,11 @@ namespace MediaBrowser.Api returnItems = _libraryManager.ReplaceVideosWithPrimaryVersions(returnItems); + var pagedItems = ApplyPaging(returnItems, request.StartIndex, request.Limit); + var dtoOptions = GetDtoOptions(request); - var dtos = _dtoService.GetBaseItemDtos(returnItems, dtoOptions, user) + var dtos = _dtoService.GetBaseItemDtos(pagedItems, dtoOptions, user) .ToArray(); return new ItemsResult