Merge pull request #2118 from chaosinnovator/master
Add StartIndex result to /Items API query
This commit is contained in:
commit
9744f5aee3
|
@ -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…
Reference in New Issue
Block a user