mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 22:17:25 -04:00
Add StartIndex result to /Items API query
This commit is contained in:
parent
6f283d80dc
commit
b98e25a07e
2 changed files with 12 additions and 2 deletions
|
@ -127,6 +127,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
|
||||
var result = new QueryResult<BaseItemDto>
|
||||
{
|
||||
StartIndex = request.StartIndex.GetValueOrDefault(),
|
||||
TotalRecordCount = itemsResult.TotalRecordCount,
|
||||
Items = returnItems
|
||||
};
|
||||
|
@ -177,6 +178,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
|
||||
return new QueryResult<BaseItemDto>
|
||||
{
|
||||
StartIndex = request.StartIndex.GetValueOrDefault(),
|
||||
TotalRecordCount = result.TotalRecordCount,
|
||||
Items = dtoList
|
||||
};
|
||||
|
@ -237,7 +239,8 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
return new QueryResult<BaseItem>
|
||||
{
|
||||
Items = Array.Empty<BaseItem>(),
|
||||
TotalRecordCount = 0
|
||||
TotalRecordCount = 0,
|
||||
StartIndex = 0
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -250,7 +253,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…
Add table
Add a link
Reference in a new issue