diff --git a/MediaBrowser.Api/EnvironmentService.cs b/MediaBrowser.Api/EnvironmentService.cs index cdea172302..b65162cfa2 100644 --- a/MediaBrowser.Api/EnvironmentService.cs +++ b/MediaBrowser.Api/EnvironmentService.cs @@ -30,21 +30,21 @@ namespace MediaBrowser.Api /// Gets or sets a value indicating whether [include files]. /// /// true if [include files]; otherwise, false. - [ApiMember(Name = "IncludeFiles", Description = "An optional filter to include or exclude files from the results.", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")] + [ApiMember(Name = "IncludeFiles", Description = "An optional filter to include or exclude files from the results. true/false", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")] public bool IncludeFiles { get; set; } /// /// Gets or sets a value indicating whether [include directories]. /// /// true if [include directories]; otherwise, false. - [ApiMember(Name = "IncludeDirectories", Description = "An optional filter to include or exclude folders from the results.", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")] + [ApiMember(Name = "IncludeDirectories", Description = "An optional filter to include or exclude folders from the results. true/false", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")] public bool IncludeDirectories { get; set; } /// /// Gets or sets a value indicating whether [include hidden]. /// /// true if [include hidden]; otherwise, false. - [ApiMember(Name = "IncludeHidden", Description = "An optional filter to include or exclude hidden files and folders.", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")] + [ApiMember(Name = "IncludeHidden", Description = "An optional filter to include or exclude hidden files and folders. true/false", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")] public bool IncludeHidden { get; set; } public GetDirectoryContents() diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs index c7adf58efb..ae15500dfd 100644 --- a/MediaBrowser.Api/Library/LibraryService.cs +++ b/MediaBrowser.Api/Library/LibraryService.cs @@ -30,7 +30,7 @@ namespace MediaBrowser.Api.Library /// Gets or sets a value indicating whether this instance has internet provider. /// /// true if this instance has internet provider; otherwise, false. - [ApiMember(Name = "HasInternetProvider", Description = "Optional filter by item types that have internet providers", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")] + [ApiMember(Name = "HasInternetProvider", Description = "Optional filter by item types that have internet providers. true/false", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")] public bool HasInternetProvider { get; set; } } diff --git a/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs b/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs index d63cee3f76..b36beec630 100644 --- a/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs +++ b/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs @@ -184,7 +184,7 @@ namespace MediaBrowser.Api.UserLibrary /// Gets or sets a value indicating whether this is recursive. /// /// true if recursive; otherwise, false. - [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")] + [ApiMember(Name = "Recursive", Description = "When searching within folders, this determines whether or not the search will be recursive. true/false", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")] public bool Recursive { get; set; } /// diff --git a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs index c9bab06858..ef4b2e7038 100644 --- a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs +++ b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs @@ -4,13 +4,11 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Model.Connectivity; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Serialization; using MediaBrowser.Server.Implementations.HttpServer; using ServiceStack.ServiceHost; using ServiceStack.Text.Controller; using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Threading.Tasks; @@ -21,12 +19,14 @@ namespace MediaBrowser.Api.UserLibrary /// [Route("/Users/{UserId}/Items/{Id}", "GET")] [Route("/Users/{UserId}/Items/Root", "GET")] + [ServiceStack.ServiceHost.Api(Description = "Gets an item from a user's library")] public class GetItem : IReturn { /// /// Gets or sets the user id. /// /// The user id. + [ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] public Guid UserId { get; set; } /// @@ -47,6 +47,7 @@ namespace MediaBrowser.Api.UserLibrary /// Gets or sets the user id. /// /// The user id. + [ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] public Guid UserId { get; set; } /// @@ -74,12 +75,14 @@ namespace MediaBrowser.Api.UserLibrary /// Class MarkFavoriteItem /// [Route("/Users/{UserId}/FavoriteItems/{Id}", "POST")] + [ServiceStack.ServiceHost.Api(Description = "Marks an item as a favorite")] public class MarkFavoriteItem : IReturnVoid { /// /// Gets or sets the user id. /// /// The user id. + [ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] public Guid UserId { get; set; } /// @@ -93,12 +96,14 @@ namespace MediaBrowser.Api.UserLibrary /// Class UnmarkFavoriteItem /// [Route("/Users/{UserId}/FavoriteItems/{Id}", "DELETE")] + [ServiceStack.ServiceHost.Api(Description = "Unmarks an item as a favorite")] public class UnmarkFavoriteItem : IReturnVoid { /// /// Gets or sets the user id. /// /// The user id. + [ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")] public Guid UserId { get; set; } /// @@ -112,12 +117,14 @@ namespace MediaBrowser.Api.UserLibrary /// Class ClearUserItemRating /// [Route("/Users/{UserId}/Items/{Id}/Rating", "DELETE")] + [ServiceStack.ServiceHost.Api(Description = "Deletes a user's saved personal rating for an item")] public class DeleteUserItemRating : IReturnVoid { /// /// Gets or sets the user id. /// /// The user id. + [ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")] public Guid UserId { get; set; } /// @@ -131,12 +138,14 @@ namespace MediaBrowser.Api.UserLibrary /// Class UpdateUserItemRating /// [Route("/Users/{UserId}/Items/{Id}/Rating", "POST")] + [ServiceStack.ServiceHost.Api(Description = "Updates a user's rating for an item")] public class UpdateUserItemRating : IReturnVoid { /// /// Gets or sets the user id. /// /// The user id. + [ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] public Guid UserId { get; set; } /// @@ -156,12 +165,14 @@ namespace MediaBrowser.Api.UserLibrary /// Class MarkPlayedItem /// [Route("/Users/{UserId}/PlayedItems/{Id}", "POST")] + [ServiceStack.ServiceHost.Api(Description = "Marks an item as played")] public class MarkPlayedItem : IReturnVoid { /// /// Gets or sets the user id. /// /// The user id. + [ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] public Guid UserId { get; set; } /// @@ -175,12 +186,14 @@ namespace MediaBrowser.Api.UserLibrary /// Class MarkUnplayedItem /// [Route("/Users/{UserId}/PlayedItems/{Id}", "DELETE")] + [ServiceStack.ServiceHost.Api(Description = "Marks an item as unplayed")] public class MarkUnplayedItem : IReturnVoid { /// /// Gets or sets the user id. /// /// The user id. + [ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")] public Guid UserId { get; set; } /// @@ -197,6 +210,7 @@ namespace MediaBrowser.Api.UserLibrary /// Gets or sets the user id. /// /// The user id. + [ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] public Guid UserId { get; set; } /// @@ -213,6 +227,7 @@ namespace MediaBrowser.Api.UserLibrary /// Gets or sets the user id. /// /// The user id. + [ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] public Guid UserId { get; set; } /// @@ -235,6 +250,7 @@ namespace MediaBrowser.Api.UserLibrary /// Gets or sets the user id. /// /// The user id. + [ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")] public Guid UserId { get; set; } /// @@ -254,18 +270,21 @@ namespace MediaBrowser.Api.UserLibrary /// Class GetLocalTrailers /// [Route("/Users/{UserId}/Items/{Id}/LocalTrailers", "GET")] + [ServiceStack.ServiceHost.Api(Description = "Gets local trailers for an item")] public class GetLocalTrailers : IReturn> { /// /// Gets or sets the user id. /// /// The user id. + [ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] public Guid UserId { get; set; } /// /// Gets or sets the id. /// /// The id. + [ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")] public string Id { get; set; } } @@ -273,18 +292,21 @@ namespace MediaBrowser.Api.UserLibrary /// Class GetSpecialFeatures /// [Route("/Users/{UserId}/Items/{Id}/SpecialFeatures", "GET")] + [ServiceStack.ServiceHost.Api(Description = "Gets special features for a movie")] public class GetSpecialFeatures : IReturn> { /// /// Gets or sets the user id. /// /// The user id. + [ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] public Guid UserId { get; set; } /// /// Gets or sets the id. /// /// The id. + [ApiMember(Name = "Id", Description = "Movie Id", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")] public string Id { get; set; } } @@ -294,11 +316,6 @@ namespace MediaBrowser.Api.UserLibrary /// public class UserLibraryService : BaseRestService { - /// - /// The _json serializer - /// - private readonly IJsonSerializer _jsonSerializer; - /// /// The _user manager /// @@ -309,17 +326,10 @@ namespace MediaBrowser.Api.UserLibrary /// /// Initializes a new instance of the class. /// - /// The json serializer. /// jsonSerializer - public UserLibraryService(IJsonSerializer jsonSerializer, IUserManager userManager, ILibraryManager libraryManager) + public UserLibraryService(IUserManager userManager, ILibraryManager libraryManager) : base() { - if (jsonSerializer == null) - { - throw new ArgumentNullException("jsonSerializer"); - } - - _jsonSerializer = jsonSerializer; _userManager = userManager; _libraryManager = libraryManager; }