Pārlūkot izejas kodu

api comments for genres, studios, years, persons

LukePulverenti 12 gadi atpakaļ
vecāks
revīzija
39ab10c875

+ 16 - 4
MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs

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

+ 1 - 0
MediaBrowser.Api/UserLibrary/GenresService.cs

@@ -13,6 +13,7 @@ namespace MediaBrowser.Api.UserLibrary
     /// </summary>
     /// </summary>
     [Route("/Users/{UserId}/Items/{Id}/Genres", "GET")]
     [Route("/Users/{UserId}/Items/{Id}/Genres", "GET")]
     [Route("/Users/{UserId}/Items/Root/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
     public class GetGenres : GetItemsByName
     {
     {
     }
     }

+ 2 - 3
MediaBrowser.Api/UserLibrary/PersonsService.cs

@@ -1,6 +1,4 @@
-using MediaBrowser.Common.Net;
-using MediaBrowser.Controller;
-using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Library;
 using ServiceStack.ServiceHost;
 using ServiceStack.ServiceHost;
 using System;
 using System;
@@ -15,6 +13,7 @@ namespace MediaBrowser.Api.UserLibrary
     /// </summary>
     /// </summary>
     [Route("/Users/{UserId}/Items/{Id}/Persons", "GET")]
     [Route("/Users/{UserId}/Items/{Id}/Persons", "GET")]
     [Route("/Users/{UserId}/Items/Root/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
     public class GetPersons : GetItemsByName
     {
     {
         /// <summary>
         /// <summary>

+ 1 - 0
MediaBrowser.Api/UserLibrary/StudiosService.cs

@@ -13,6 +13,7 @@ namespace MediaBrowser.Api.UserLibrary
     /// </summary>
     /// </summary>
     [Route("/Users/{UserId}/Items/{Id}/Studios", "GET")]
     [Route("/Users/{UserId}/Items/{Id}/Studios", "GET")]
     [Route("/Users/{UserId}/Items/Root/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
     public class GetStudios : GetItemsByName
     {
     {
     }
     }

+ 1 - 0
MediaBrowser.Api/UserLibrary/YearsService.cs

@@ -14,6 +14,7 @@ namespace MediaBrowser.Api.UserLibrary
     /// </summary>
     /// </summary>
     [Route("/Users/{UserId}/Items/{Id}/Years", "GET")]
     [Route("/Users/{UserId}/Items/{Id}/Years", "GET")]
     [Route("/Users/{UserId}/Items/Root/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
     public class GetYears : GetItemsByName
     {
     {
     }
     }

+ 1 - 1
MediaBrowser.Model/Dto/ItemsByNameQuery.cs

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