From c4c9126f79f43ad865cfa670bda90a94ffb39d9c Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Fri, 8 Mar 2013 14:14:09 -0500 Subject: [PATCH] added more attributes for api docs --- .../{ServerEntryPoint.cs => ApiEntryPoint.cs} | 8 +++--- MediaBrowser.Api/ApiService.cs | 24 ----------------- MediaBrowser.Api/EnvironmentService.cs | 26 +++++++++++++++---- MediaBrowser.Api/Javascript/ApiClient.js | 6 ++--- MediaBrowser.Api/LocalizationService.cs | 3 +++ MediaBrowser.Api/MediaBrowser.Api.csproj | 3 +-- MediaBrowser.Api/PackageService.cs | 12 +++++++++ .../Playback/BaseStreamingService.cs | 6 ++--- .../Playback/Hls/BaseHlsService.cs | 4 +-- .../BaseProgressiveStreamingService.cs | 4 +-- .../Progressive/ProgressiveStreamWriter.cs | 2 +- MediaBrowser.Api/PluginService.cs | 13 ++++++++++ MediaBrowser.Api/SystemService.cs | 7 +++-- MediaBrowser.Api/UserService.cs | 26 +++++++------------ .../ApplicationHost.cs | 2 +- .../Html/scripts/site.js | 2 +- 16 files changed, 82 insertions(+), 66 deletions(-) rename MediaBrowser.Api/{ServerEntryPoint.cs => ApiEntryPoint.cs} (97%) delete mode 100644 MediaBrowser.Api/ApiService.cs diff --git a/MediaBrowser.Api/ServerEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.cs similarity index 97% rename from MediaBrowser.Api/ServerEntryPoint.cs rename to MediaBrowser.Api/ApiEntryPoint.cs index 663d1aeca2..9003c72630 100644 --- a/MediaBrowser.Api/ServerEntryPoint.cs +++ b/MediaBrowser.Api/ApiEntryPoint.cs @@ -13,12 +13,12 @@ namespace MediaBrowser.Api /// /// Class ServerEntryPoint /// - public class ServerEntryPoint : IServerEntryPoint + public class ApiEntryPoint : IServerEntryPoint { /// /// The instance /// - public static ServerEntryPoint Instance; + public static ApiEntryPoint Instance; /// /// Gets or sets the logger. @@ -27,10 +27,10 @@ namespace MediaBrowser.Api private ILogger Logger { get; set; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The logger. - public ServerEntryPoint(ILogger logger) + public ApiEntryPoint(ILogger logger) { Logger = logger; diff --git a/MediaBrowser.Api/ApiService.cs b/MediaBrowser.Api/ApiService.cs deleted file mode 100644 index 33ea492e05..0000000000 --- a/MediaBrowser.Api/ApiService.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Net; - -namespace MediaBrowser.Api -{ - /// - /// Contains some helpers for the api - /// - public static class ApiService - { - /// - /// Determines whether [is API URL match] [the specified URL]. - /// - /// The URL. - /// The request. - /// true if [is API URL match] [the specified URL]; otherwise, false. - public static bool IsApiUrlMatch(string url, HttpListenerRequest request) - { - url = "/api/" + url; - - return request.Url.LocalPath.EndsWith(url, StringComparison.OrdinalIgnoreCase); - } - } -} diff --git a/MediaBrowser.Api/EnvironmentService.cs b/MediaBrowser.Api/EnvironmentService.cs index 6296711ed3..dfa5eee425 100644 --- a/MediaBrowser.Api/EnvironmentService.cs +++ b/MediaBrowser.Api/EnvironmentService.cs @@ -16,34 +16,49 @@ namespace MediaBrowser.Api /// Class GetDirectoryContents /// [Route("/Environment/DirectoryContents", "GET")] + [ServiceStack.ServiceHost.Api(Description = "Gets the contents of a given directory in the file system")] public class GetDirectoryContents : IReturn> { /// /// Gets or sets the path. /// /// The path. + [ApiMember(Name = "Path", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")] public string Path { get; set; } + /// /// 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 = "string", 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 = "string", 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 = "string", ParameterType = "query", Verb = "GET")] public bool IncludeHidden { get; set; } + + public GetDirectoryContents() + { + IncludeDirectories = true; + IncludeFiles = true; + } } /// /// Class GetDrives /// [Route("/Environment/Drives", "GET")] + [ServiceStack.ServiceHost.Api(Description = "Gets available drives from the server's file system")] public class GetDrives : IReturn> { } @@ -51,8 +66,9 @@ namespace MediaBrowser.Api /// /// Class GetNetworkComputers /// - [Route("/Environment/NetworkComputers", "GET")] - public class GetNetworkComputers : IReturn> + [Route("/Environment/NetworkDevices", "GET")] + [ServiceStack.ServiceHost.Api(Description = "Gets a list of devices on the network")] + public class GetNetworkDevices : IReturn> { } @@ -128,9 +144,9 @@ namespace MediaBrowser.Api /// /// The request. /// System.Object. - public object Get(GetNetworkComputers request) + public object Get(GetNetworkDevices request) { - var result = GetNetworkComputers().ToList(); + var result = GetNetworkDevices().ToList(); return ToOptimizedResult(result); } @@ -155,7 +171,7 @@ namespace MediaBrowser.Api /// Gets the network computers. /// /// IEnumerable{FileSystemEntryInfo}. - private IEnumerable GetNetworkComputers() + private IEnumerable GetNetworkDevices() { return _networkManager.GetNetworkDevices().Select(c => new FileSystemEntryInfo { diff --git a/MediaBrowser.Api/Javascript/ApiClient.js b/MediaBrowser.Api/Javascript/ApiClient.js index 08082c389c..9a4220eacc 100644 --- a/MediaBrowser.Api/Javascript/ApiClient.js +++ b/MediaBrowser.Api/Javascript/ApiClient.js @@ -194,11 +194,11 @@ var ApiClient = { }, /** - * Gets a list of network computers from the server + * Gets a list of network devices from the server */ - getNetworkComputers: function () { + getNetworkDevices: function () { - var url = ApiClient.getUrl("Environment/NetworkComputers"); + var url = ApiClient.getUrl("Environment/NetworkDevices"); return $.getJSON(url); }, diff --git a/MediaBrowser.Api/LocalizationService.cs b/MediaBrowser.Api/LocalizationService.cs index 1493e8e44f..ed5de76835 100644 --- a/MediaBrowser.Api/LocalizationService.cs +++ b/MediaBrowser.Api/LocalizationService.cs @@ -14,6 +14,7 @@ namespace MediaBrowser.Api /// Class GetCultures /// [Route("/Localization/Cultures", "GET")] + [ServiceStack.ServiceHost.Api(Description = "Gets known cultures")] public class GetCultures : IReturn> { } @@ -22,6 +23,7 @@ namespace MediaBrowser.Api /// Class GetCountries /// [Route("/Localization/Countries", "GET")] + [ServiceStack.ServiceHost.Api(Description = "Gets known countries")] public class GetCountries : IReturn> { } @@ -30,6 +32,7 @@ namespace MediaBrowser.Api /// Class ParentalRatings /// [Route("/Localization/ParentalRatings", "GET")] + [ServiceStack.ServiceHost.Api(Description = "Gets known parental ratings")] public class GetParentalRatings : IReturn> { } diff --git a/MediaBrowser.Api/MediaBrowser.Api.csproj b/MediaBrowser.Api/MediaBrowser.Api.csproj index 5cedbf85fb..8444dc46cc 100644 --- a/MediaBrowser.Api/MediaBrowser.Api.csproj +++ b/MediaBrowser.Api/MediaBrowser.Api.csproj @@ -81,7 +81,6 @@ Properties\SharedVersion.cs - @@ -105,7 +104,7 @@ - + diff --git a/MediaBrowser.Api/PackageService.cs b/MediaBrowser.Api/PackageService.cs index e8ff02539c..b09830c546 100644 --- a/MediaBrowser.Api/PackageService.cs +++ b/MediaBrowser.Api/PackageService.cs @@ -16,12 +16,14 @@ namespace MediaBrowser.Api /// Class GetPackage /// [Route("/Packages/{Name}", "GET")] + [ServiceStack.ServiceHost.Api(("Gets a package, by name"))] public class GetPackage : IReturn { /// /// Gets or sets the name. /// /// The name. + [ApiMember(Name = "Name", Description = "The name of the package", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] public string Name { get; set; } } @@ -29,12 +31,14 @@ namespace MediaBrowser.Api /// Class GetPackages /// [Route("/Packages", "GET")] + [ServiceStack.ServiceHost.Api(("Gets available packages"))] public class GetPackages : IReturn> { /// /// Gets or sets the name. /// /// The name. + [ApiMember(Name = "PackageType", Description = "Optional package type filter (System/UserInstalled)", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] public PackageType? PackageType { get; set; } } @@ -42,12 +46,14 @@ namespace MediaBrowser.Api /// Class GetPackageVersionUpdates /// [Route("/Packages/Updates", "GET")] + [ServiceStack.ServiceHost.Api(("Gets available package updates for currently installed packages"))] public class GetPackageVersionUpdates : IReturn> { /// /// Gets or sets the name. /// /// The name. + [ApiMember(Name = "PackageType", Description = "Package type filter (System/UserInstalled)", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")] public PackageType PackageType { get; set; } } @@ -55,24 +61,28 @@ namespace MediaBrowser.Api /// Class InstallPackage /// [Route("/Packages/Installed/{Name}", "POST")] + [ServiceStack.ServiceHost.Api(("Installs a package"))] public class InstallPackage : IReturnVoid { /// /// Gets or sets the name. /// /// The name. + [ApiMember(Name = "Name", Description = "Package name", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] public string Name { get; set; } /// /// Gets or sets the version. /// /// The version. + [ApiMember(Name = "Version", Description = "Optional version. Defaults to latest version.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")] public string Version { get; set; } /// /// Gets or sets the update class. /// /// The update class. + [ApiMember(Name = "UpdateClass", Description = "Optional update class (Dev, Beta, Release). Defaults to Release.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")] public PackageVersionClass UpdateClass { get; set; } } @@ -80,12 +90,14 @@ namespace MediaBrowser.Api /// Class CancelPackageInstallation /// [Route("/Packages/Installing/{Id}", "DELETE")] + [ServiceStack.ServiceHost.Api(("Cancels a package installation"))] public class CancelPackageInstallation : IReturnVoid { /// /// Gets or sets the id. /// /// The id. + [ApiMember(Name = "Id", Description = "Installation Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")] public Guid Id { get; set; } } diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 012a553634..bc07f93de0 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -516,7 +516,7 @@ namespace MediaBrowser.Api.Playback EnableRaisingEvents = true }; - ServerEntryPoint.Instance.OnTranscodeBeginning(outputPath, TranscodingJobType, process); + ApiEntryPoint.Instance.OnTranscodeBeginning(outputPath, TranscodingJobType, process); Logger.Info(process.StartInfo.FileName + " " + process.StartInfo.Arguments); @@ -535,7 +535,7 @@ namespace MediaBrowser.Api.Playback { Logger.ErrorException("Error starting ffmpeg", ex); - ServerEntryPoint.Instance.OnTranscodeFailedToStart(outputPath, TranscodingJobType); + ApiEntryPoint.Instance.OnTranscodeFailedToStart(outputPath, TranscodingJobType); state.LogFileStream.Dispose(); @@ -586,7 +586,7 @@ namespace MediaBrowser.Api.Playback process.Dispose(); - ServerEntryPoint.Instance.OnTranscodingFinished(outputFilePath, TranscodingJobType); + ApiEntryPoint.Instance.OnTranscodingFinished(outputFilePath, TranscodingJobType); if (!exitCode.HasValue || exitCode.Value != 0) { diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index f73109dd00..6a303a03e2 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -77,7 +77,7 @@ namespace MediaBrowser.Api.Playback.Hls } else { - ServerEntryPoint.Instance.OnTranscodeBeginRequest(playlist, TranscodingJobType.Hls); + ApiEntryPoint.Instance.OnTranscodeBeginRequest(playlist, TranscodingJobType.Hls); } // Get the current playlist text and convert to bytes @@ -94,7 +94,7 @@ namespace MediaBrowser.Api.Playback.Hls } finally { - ServerEntryPoint.Instance.OnTranscodeEndRequest(playlist, TranscodingJobType.Hls); + ApiEntryPoint.Instance.OnTranscodeEndRequest(playlist, TranscodingJobType.Hls); } } diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs index eba8decf2f..c2cdf1f9ba 100644 --- a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs +++ b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs @@ -104,7 +104,7 @@ namespace MediaBrowser.Api.Playback.Progressive var outputPath = GetOutputFilePath(state); - if (File.Exists(outputPath) && !ServerEntryPoint.Instance.HasActiveTranscodingJob(outputPath, TranscodingJobType.Progressive)) + if (File.Exists(outputPath) && !ApiEntryPoint.Instance.HasActiveTranscodingJob(outputPath, TranscodingJobType.Progressive)) { return ToStaticFileResult(outputPath); } @@ -130,7 +130,7 @@ namespace MediaBrowser.Api.Playback.Progressive } else { - ServerEntryPoint.Instance.OnTranscodeBeginRequest(outputPath, TranscodingJobType.Progressive); + ApiEntryPoint.Instance.OnTranscodeBeginRequest(outputPath, TranscodingJobType.Progressive); } return new ProgressiveStreamWriter diff --git a/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs b/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs index b6b73c78dd..e9e1340028 100644 --- a/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs +++ b/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs @@ -41,7 +41,7 @@ namespace MediaBrowser.Api.Playback.Progressive } finally { - ServerEntryPoint.Instance.OnTranscodeEndRequest(Path, TranscodingJobType.Progressive); + ApiEntryPoint.Instance.OnTranscodeEndRequest(Path, TranscodingJobType.Progressive); } } diff --git a/MediaBrowser.Api/PluginService.cs b/MediaBrowser.Api/PluginService.cs index 847478beb1..3f41460203 100644 --- a/MediaBrowser.Api/PluginService.cs +++ b/MediaBrowser.Api/PluginService.cs @@ -19,6 +19,7 @@ namespace MediaBrowser.Api /// Class Plugins /// [Route("/Plugins", "GET")] + [ServiceStack.ServiceHost.Api(("Gets a list of currently installed plugins"))] public class GetPlugins : IReturn> { } @@ -27,12 +28,14 @@ namespace MediaBrowser.Api /// Class GetPluginAssembly /// [Route("/Plugins/{Id}/Assembly", "GET")] + [ServiceStack.ServiceHost.Api(("Gets a plugin assembly file"))] public class GetPluginAssembly { /// /// Gets or sets the id. /// /// The id. + [ApiMember(Name = "Id", Description = "Plugin Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] public Guid Id { get; set; } } @@ -40,12 +43,14 @@ namespace MediaBrowser.Api /// Class UninstallPlugin /// [Route("/Plugins/{Id}", "DELETE")] + [ServiceStack.ServiceHost.Api(("Uninstalls a plugin"))] public class UninstallPlugin : IReturnVoid { /// /// Gets or sets the id. /// /// The id. + [ApiMember(Name = "Id", Description = "Plugin Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")] public Guid Id { get; set; } } @@ -53,12 +58,14 @@ namespace MediaBrowser.Api /// Class GetPluginConfiguration /// [Route("/Plugins/{Id}/Configuration", "GET")] + [ServiceStack.ServiceHost.Api(("Gets a plugin's configuration"))] public class GetPluginConfiguration { /// /// Gets or sets the id. /// /// The id. + [ApiMember(Name = "Id", Description = "Plugin Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] public Guid Id { get; set; } } @@ -66,12 +73,14 @@ namespace MediaBrowser.Api /// Class UpdatePluginConfiguration /// [Route("/Plugins/{Id}/Configuration", "POST")] + [ServiceStack.ServiceHost.Api(("Updates a plugin's configuration"))] public class UpdatePluginConfiguration : IRequiresRequestStream, IReturnVoid { /// /// Gets or sets the id. /// /// The id. + [ApiMember(Name = "Id", Description = "Plugin Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] public Guid Id { get; set; } /// @@ -85,12 +94,14 @@ namespace MediaBrowser.Api /// Class GetPluginConfigurationFile /// [Route("/Plugins/{Id}/ConfigurationFile", "GET")] + [ServiceStack.ServiceHost.Api(("Gets a plugin's configuration file, in plain text"))] public class GetPluginConfigurationFile { /// /// Gets or sets the id. /// /// The id. + [ApiMember(Name = "Id", Description = "Plugin Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] public Guid Id { get; set; } } @@ -98,6 +109,7 @@ namespace MediaBrowser.Api /// Class GetPluginSecurityInfo /// [Route("/Plugins/SecurityInfo", "GET")] + [ServiceStack.ServiceHost.Api(("Gets plugin registration information"))] public class GetPluginSecurityInfo : IReturn { } @@ -106,6 +118,7 @@ namespace MediaBrowser.Api /// Class UpdatePluginSecurityInfo /// [Route("/Plugins/SecurityInfo", "POST")] + [ServiceStack.ServiceHost.Api(("Updates plugin registration information"))] public class UpdatePluginSecurityInfo : PluginSecurityInfo, IReturnVoid { } diff --git a/MediaBrowser.Api/SystemService.cs b/MediaBrowser.Api/SystemService.cs index 3fdf621c0f..a0137652e9 100644 --- a/MediaBrowser.Api/SystemService.cs +++ b/MediaBrowser.Api/SystemService.cs @@ -1,5 +1,4 @@ -using MediaBrowser.Common; -using MediaBrowser.Common.Extensions; +using MediaBrowser.Common.Extensions; using MediaBrowser.Controller; using MediaBrowser.Controller.Configuration; using MediaBrowser.Model.Configuration; @@ -17,6 +16,7 @@ namespace MediaBrowser.Api /// Class GetSystemInfo /// [Route("/System/Info", "GET")] + [ServiceStack.ServiceHost.Api(Description = "Gets information about the server")] public class GetSystemInfo : IReturn { @@ -32,6 +32,7 @@ namespace MediaBrowser.Api } [Route("/System/Shutdown", "POST")] + [ServiceStack.ServiceHost.Api(("Shuts down the application"))] public class ShutdownApplication { } @@ -40,6 +41,7 @@ namespace MediaBrowser.Api /// Class GetConfiguration /// [Route("/System/Configuration", "GET")] + [ServiceStack.ServiceHost.Api(("Gets application configuration"))] public class GetConfiguration : IReturn { @@ -49,6 +51,7 @@ namespace MediaBrowser.Api /// Class UpdateConfiguration /// [Route("/System/Configuration", "POST")] + [ServiceStack.ServiceHost.Api(("Updates application configuration"))] public class UpdateConfiguration : ServerConfiguration, IReturnVoid { } diff --git a/MediaBrowser.Api/UserService.cs b/MediaBrowser.Api/UserService.cs index 0eecad652a..bcc3a61e0e 100644 --- a/MediaBrowser.Api/UserService.cs +++ b/MediaBrowser.Api/UserService.cs @@ -24,6 +24,7 @@ namespace MediaBrowser.Api /// Class GetUser /// [Route("/Users/{Id}", "GET")] + [ServiceStack.ServiceHost.Api(Description = "Gets a user by Id")] public class GetUser : IReturn { /// @@ -38,13 +39,14 @@ namespace MediaBrowser.Api /// Class DeleteUser /// [Route("/Users/{Id}", "DELETE")] + [ServiceStack.ServiceHost.Api(Description = "Deletes a user")] public class DeleteUser : IReturnVoid { /// /// Gets or sets the id. /// /// The id. - [ApiMember(Name = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] + [ApiMember(Name = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")] public Guid Id { get; set; } } @@ -52,20 +54,21 @@ namespace MediaBrowser.Api /// Class AuthenticateUser /// [Route("/Users/{Id}/Authenticate", "POST")] + [ServiceStack.ServiceHost.Api(Description = "Authenticates a user")] public class AuthenticateUser : IReturnVoid { /// /// Gets or sets the id. /// /// The id. - [ApiMember(Name = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] + [ApiMember(Name = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] public Guid Id { get; set; } /// /// Gets or sets the password. /// /// The password. - [ApiMember(Name = "Password", IsRequired = true, DataType = "string", ParameterType = "body", Verb = "GET")] + [ApiMember(Name = "Password", IsRequired = true, DataType = "string", ParameterType = "body", Verb = "POST")] public string Password { get; set; } } @@ -73,6 +76,7 @@ namespace MediaBrowser.Api /// Class UpdateUserPassword /// [Route("/Users/{Id}/Password", "POST")] + [ServiceStack.ServiceHost.Api(Description = "Updates a user's password")] public class UpdateUserPassword : IReturnVoid { /// @@ -104,6 +108,7 @@ namespace MediaBrowser.Api /// Class UpdateUser /// [Route("/Users/{Id}", "POST")] + [ServiceStack.ServiceHost.Api(Description = "Updates a user")] public class UpdateUser : UserDto, IReturnVoid { } @@ -112,6 +117,7 @@ namespace MediaBrowser.Api /// Class CreateUser /// [Route("/Users", "POST")] + [ServiceStack.ServiceHost.Api(Description = "Creates a user")] public class CreateUser : UserDto, IReturn { } @@ -126,11 +132,6 @@ namespace MediaBrowser.Api /// private readonly IXmlSerializer _xmlSerializer; - /// - /// The _json serializer - /// - private readonly IJsonSerializer _jsonSerializer; - /// /// The _user manager /// @@ -140,22 +141,15 @@ namespace MediaBrowser.Api /// Initializes a new instance of the class. /// /// The XML serializer. - /// The json serializer. /// xmlSerializer - public UserService(IXmlSerializer xmlSerializer, IJsonSerializer jsonSerializer, IUserManager userManager) + public UserService(IXmlSerializer xmlSerializer, IUserManager userManager) : base() { - if (jsonSerializer == null) - { - throw new ArgumentNullException("jsonSerializer"); - } - if (xmlSerializer == null) { throw new ArgumentNullException("xmlSerializer"); } - _jsonSerializer = jsonSerializer; _xmlSerializer = xmlSerializer; _userManager = userManager; } diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index 179a2e2402..c822aae847 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -295,7 +295,7 @@ namespace MediaBrowser.ServerApplication } // Include composable parts in the Api assembly - yield return typeof(ApiService).Assembly; + yield return typeof(ApiEntryPoint).Assembly; // Include composable parts in the Dashboard assembly yield return typeof(DashboardInfo).Assembly; diff --git a/MediaBrowser.WebDashboard/Html/scripts/site.js b/MediaBrowser.WebDashboard/Html/scripts/site.js index 94e3390d3b..d2c9526ed5 100644 --- a/MediaBrowser.WebDashboard/Html/scripts/site.js +++ b/MediaBrowser.WebDashboard/Html/scripts/site.js @@ -574,7 +574,7 @@ var Dashboard = { var promise; if (path === "Network") { - promise = ApiClient.getNetworkComputers(); + promise = ApiClient.getNetworkDevices(); } else if (path) { promise = ApiClient.getDirectoryContents(path, { includeDirectories: true });