Merge pull request #2118 from chaosinnovator/master

Add StartIndex result to /Items API query
pull/2142/head
Joshua M. Boniface 5 years ago committed by GitHub
commit 9744f5aee3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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
};
}

@ -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>();

Loading…
Cancel
Save