api comments for genres, studios, years, persons

This commit is contained in:
LukePulverenti 2013-03-08 16:56:07 -05:00
parent 34cc4eee9d
commit 39ab10c875
6 changed files with 22 additions and 8 deletions

View File

@ -67,16 +67,16 @@ namespace MediaBrowser.Api.UserLibrary
TotalRecordCount = ibnItemsArray.Length
};
if (request.StartIndex.HasValue || request.PageSize.HasValue)
if (request.StartIndex.HasValue || request.Limit.HasValue)
{
if (request.StartIndex.HasValue)
{
ibnItems = ibnItems.Skip(request.StartIndex.Value);
}
if (request.PageSize.HasValue)
if (request.Limit.HasValue)
{
ibnItems = ibnItems.Take(request.PageSize.Value);
ibnItems = ibnItems.Take(request.Limit.Value);
}
}
@ -163,32 +163,44 @@ namespace MediaBrowser.Api.UserLibrary
/// Gets or sets the user id.
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
public Guid UserId { get; set; }
/// <summary>
/// Gets or sets the start index.
/// </summary>
/// <value>The start index.</value>
[ApiMember(Name = "StartIndex", Description = "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; }
/// <summary>
/// Gets or sets the size of the page.
/// </summary>
/// <value>The size of the page.</value>
public int? PageSize { get; set; }
[ApiMember(Name = "Limit", Description = "The maximum number of records to return", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
public int? Limit { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this <see cref="GetItemsByName" /> is recursive.
/// </summary>
/// <value><c>true</c> if recursive; otherwise, <c>false</c>.</value>
[ApiMember(Name = "Recursive", Description = "When searching within folders, this determines whether or not the search will be recursive.", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")]
public bool Recursive { get; set; }
/// <summary>
/// Gets or sets the sort order.
/// </summary>
/// <value>The sort order.</value>
[ApiMember(Name = "SortOrder", Description = "Sort Order - Ascending,Descending", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public SortOrder? SortOrder { get; set; }
/// <summary>
/// If specified the search will be localized within a specific item or folder
/// </summary>
/// <value>The item id.</value>
[ApiMember(Name = "Id", Description = "If specified the search will be localized within a specific item or folder", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string Id { get; set; }
/// <summary>
/// Fields to return within the items, in addition to basic information
/// </summary>

View File

@ -13,6 +13,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
[Route("/Users/{UserId}/Items/{Id}/Genres", "GET")]
[Route("/Users/{UserId}/Items/Root/Genres", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets all genres from a given item, folder, or the entire library")]
public class GetGenres : GetItemsByName
{
}

View File

@ -1,6 +1,4 @@
using MediaBrowser.Common.Net;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using ServiceStack.ServiceHost;
using System;
@ -15,6 +13,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
[Route("/Users/{UserId}/Items/{Id}/Persons", "GET")]
[Route("/Users/{UserId}/Items/Root/Persons", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets all persons from a given item, folder, or the entire library")]
public class GetPersons : GetItemsByName
{
/// <summary>

View File

@ -13,6 +13,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
[Route("/Users/{UserId}/Items/{Id}/Studios", "GET")]
[Route("/Users/{UserId}/Items/Root/Studios", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets all studios from a given item, folder, or the entire library")]
public class GetStudios : GetItemsByName
{
}

View File

@ -14,6 +14,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
[Route("/Users/{UserId}/Items/{Id}/Years", "GET")]
[Route("/Users/{UserId}/Items/Root/Years", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets all years from a given item, folder, or the entire library")]
public class GetYears : GetItemsByName
{
}

View File

@ -22,7 +22,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the size of the page.
/// </summary>
/// <value>The size of the page.</value>
public int? PageSize { get; set; }
public int? Limit { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this <see cref="GetItemsByName" /> is recursive.
/// </summary>