From c91c0ece6bba3c512e6c7f259feb3f439effe9cb Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 7 Apr 2013 20:26:31 -0400 Subject: [PATCH] Added registration status endpoint --- MediaBrowser.Api/PluginService.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/MediaBrowser.Api/PluginService.cs b/MediaBrowser.Api/PluginService.cs index c1bd40c93..bff193f5e 100644 --- a/MediaBrowser.Api/PluginService.cs +++ b/MediaBrowser.Api/PluginService.cs @@ -124,6 +124,18 @@ namespace MediaBrowser.Api { } + [Route("/Plugins/RegistrationRecord/{Name}", "GET")] + [Api("Gets registration status for a feature")] + [Restrict(VisibilityTo = EndpointAttributes.None)] + public class GetRegistrationStatus + { + [ApiMember(Name = "Name", Description = "Feature Name", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] + public string Name { get; set; } + + [ApiMember(Name = "Mb2Equivalent", Description = "Optional. The equivalent feature name in MB2", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + public string Mb2Equivalent { get; set; } + } + /// /// Class PluginsService /// @@ -164,6 +176,18 @@ namespace MediaBrowser.Api _jsonSerializer = jsonSerializer; } + /// + /// Gets the specified request. + /// + /// The request. + /// System.Object. + public object Get(GetRegistrationStatus request) + { + var result = _securityManager.GetRegistrationStatus(request.Name, request.Mb2Equivalent).Result; + + return ToOptimizedResult(result); + } + /// /// Gets the specified request. ///