Merge pull request #2118 from chaosinnovator/master

Add StartIndex result to /Items API query
This commit is contained in:
Joshua M. Boniface 2019-12-11 23:42:02 -05:00 committed by GitHub
commit 9744f5aee3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -119,6 +119,7 @@ namespace MediaBrowser.Api.UserLibrary
var result = new QueryResult<BaseItemDto>
{
StartIndex = request.StartIndex.GetValueOrDefault(),
TotalRecordCount = itemsResult.TotalRecordCount,
Items = returnItems
};
@ -169,6 +170,7 @@ namespace MediaBrowser.Api.UserLibrary
return new QueryResult<BaseItemDto>
{
StartIndex = request.StartIndex.GetValueOrDefault(),
TotalRecordCount = result.TotalRecordCount,
Items = dtoList
};
@ -229,7 +231,8 @@ namespace MediaBrowser.Api.UserLibrary
return new QueryResult<BaseItem>
{
Items = Array.Empty<BaseItem>(),
TotalRecordCount = 0
TotalRecordCount = 0,
StartIndex = 0
};
}
@ -242,7 +245,8 @@ namespace MediaBrowser.Api.UserLibrary
return new QueryResult<BaseItem>
{
Items = itemsArray,
TotalRecordCount = itemsArray.Length
TotalRecordCount = itemsArray.Length,
StartIndex = 0
};
}

View File

@ -17,6 +17,12 @@ namespace MediaBrowser.Model.Querying
/// <value>The total record count.</value>
public int TotalRecordCount { get; set; }
/// <summary>
/// The index of the first record in Items.
/// </summary>
/// <value>First record index.</value>
public int StartIndex { get; set; }
public QueryResult()
{
Items = Array.Empty<T>();