The Free Software Media System - Server Backend & API
3.2.30.17
Luke Pulverenti2f99a78230b3
diff --git a/Emby.Server.Implementations/Services/ServiceController.cs b/Emby.Server.Implementations/Services/ServiceController.csindex 4dc14a1934..3fd6d88f81 100644--- a/Emby.Server.Implementations/Services/ServiceController.cs+++ b/Emby.Server.Implementations/Services/ServiceController.cs@@ -75,7 +75,7 @@ namespace Emby.Server.Implementations.Servicesvar attrs = appHost.GetRouteAttributes(requestType);foreach (RouteAttribute attr in attrs){- var restPath = new RestPath(appHost.CreateInstance, appHost.GetParseFn, requestType, attr.Path, attr.Verbs, attr.Summary);+ var restPath = new RestPath(appHost.CreateInstance, appHost.GetParseFn, requestType, attr.Path, attr.Verbs, attr.IsHidden, attr.Summary, attr.Description);RegisterRestPath(restPath);}diff --git a/Emby.Server.Implementations/Services/ServicePath.cs b/Emby.Server.Implementations/Services/ServicePath.csindex df5d713747..0ca36df19d 100644--- a/Emby.Server.Implementations/Services/ServicePath.cs+++ b/Emby.Server.Implementations/Services/ServicePath.cs@@ -51,6 +51,8 @@ namespace Emby.Server.Implementations.Servicespublic string Path { get { return this.restPath; } }public string Summary { get; private set; }+ public string Description { get; private set; }+ public bool IsHidden { get; private set; }public int Priority { get; set; } //passed back to RouteAttribute@@ -91,10 +93,12 @@ namespace Emby.Server.Implementations.Servicesreturn list;}- public RestPath(Func<Type, object> createInstanceFn, Func<Type, Func<string, object>> getParseFn, Type requestType, string path, string verbs, string summary = null)+ public RestPath(Func<Type, object> createInstanceFn, Func<Type, Func<string, object>> getParseFn, Type requestType, string path, string verbs, bool isHidden = false, string summary = null, string description = null){this.RequestType = requestType;this.Summary = summary;+ this.IsHidden = isHidden;+ this.Description = description;this.restPath = path;this.Verbs = string.IsNullOrWhiteSpace(verbs) ? ServiceExecExtensions.AllVerbs : verbs.ToUpper().Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries);diff --git a/Emby.Server.Implementations/Services/SwaggerService.cs b/Emby.Server.Implementations/Services/SwaggerService.csindex 63cbb78dd5..be3b4cbba4 100644--- a/Emby.Server.Implementations/Services/SwaggerService.cs+++ b/Emby.Server.Implementations/Services/SwaggerService.cs@@ -21,7 +21,7 @@ namespace Emby.Server.Implementations.Servicespublic string host { get; set; }public string basePath { get; set; }public SwaggerTag[] tags { get; set; }- public Dictionary<string, Dictionary<string, SwaggerMethod>> paths { get; set; }+ public IDictionary<string, Dictionary<string, SwaggerMethod>> paths { get; set; }public Dictionary<string, SwaggerDefinition> definitions { get; set; }}@@ -147,16 +147,21 @@ namespace Emby.Server.Implementations.Servicesreturn new Dictionary<string, SwaggerDefinition>();}- private Dictionary<string, Dictionary<string, SwaggerMethod>> GetPaths()+ private IDictionary<string, Dictionary<string, SwaggerMethod>> GetPaths(){- var paths = new Dictionary<string, Dictionary<string, SwaggerMethod>>();+ var paths = new SortedDictionary<string, Dictionary<string, SwaggerMethod>>();- var all = ServiceController.Instance.RestPathMap.ToList();+ var all = ServiceController.Instance.RestPathMap.OrderBy(i => i.Key, StringComparer.OrdinalIgnoreCase).ToList();foreach (var current in all){foreach (var info in current.Value){+ if (info.IsHidden)+ {+ continue;+ }+if (info.Path.StartsWith("/mediabrowser", StringComparison.OrdinalIgnoreCase)){continue;@@ -191,6 +196,7 @@ namespace Emby.Server.Implementations.Servicesresult[verb.ToLower()] = new SwaggerMethod{summary = info.Summary,+ description = info.Description,produces = new[]{"application/json"diff --git a/MediaBrowser.Api/PluginService.cs b/MediaBrowser.Api/PluginService.csindex f6efe15e6d..1eea894312 100644--- a/MediaBrowser.Api/PluginService.cs+++ b/MediaBrowser.Api/PluginService.cs@@ -82,7 +82,7 @@ namespace MediaBrowser.Api/// <summary>/// Class GetPluginSecurityInfo/// </summary>- [Route("/Plugins/SecurityInfo", "GET", Summary = "Gets plugin registration information")]+ [Route("/Plugins/SecurityInfo", "GET", Summary = "Gets plugin registration information", IsHidden = true)][Authenticated]public class GetPluginSecurityInfo : IReturn<PluginSecurityInfo>{@@ -91,13 +91,13 @@ namespace MediaBrowser.Api/// <summary>/// Class UpdatePluginSecurityInfo/// </summary>- [Route("/Plugins/SecurityInfo", "POST", Summary = "Updates plugin registration information")]+ [Route("/Plugins/SecurityInfo", "POST", Summary = "Updates plugin registration information", IsHidden = true)][Authenticated(Roles = "Admin")]public class UpdatePluginSecurityInfo : PluginSecurityInfo, IReturnVoid{}- [Route("/Plugins/RegistrationRecords/{Name}", "GET", Summary = "Gets registration status for a feature")]+ [Route("/Plugins/RegistrationRecords/{Name}", "GET", Summary = "Gets registration status for a feature", IsHidden = true)][Authenticated]public class GetRegistrationStatus{@@ -108,7 +108,7 @@ namespace MediaBrowser.Apipublic string Mb2Equivalent { get; set; }}- [Route("/Registrations/{Name}", "GET", Summary = "Gets registration status for a feature")]+ [Route("/Registrations/{Name}", "GET", Summary = "Gets registration status for a feature", IsHidden = true)][Authenticated]public class GetRegistration : IReturn<RegistrationInfo>{@@ -116,7 +116,7 @@ namespace MediaBrowser.Apipublic string Name { get; set; }}- [Route("/Appstore/Register", "POST", Summary = "Registers an appstore sale")]+ [Route("/Appstore/Register", "POST", Summary = "Registers an appstore sale", IsHidden = true)][Authenticated]public class RegisterAppstoreSale{diff --git a/MediaBrowser.Model/Services/RouteAttribute.cs b/MediaBrowser.Model/Services/RouteAttribute.csindex 5a39688da9..264500e605 100644--- a/MediaBrowser.Model/Services/RouteAttribute.cs+++ b/MediaBrowser.Model/Services/RouteAttribute.cs@@ -88,6 +88,10 @@ namespace MediaBrowser.Model.Services/// </summary>public string Summary { get; set; }+ public string Description { get; set; }++ public bool IsHidden { get; set; }+/// <summary>/// Gets or sets longer text to explain the behaviour of the route./// </summary>diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.csindex c6bbca6728..d4d0e281e7 100644--- a/MediaBrowser.WebDashboard/Api/DashboardService.cs+++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs@@ -47,13 +47,13 @@ namespace MediaBrowser.WebDashboard.Apipublic string Name { get; set; }}- [Route("/web/Package", "GET")]+ [Route("/web/Package", "GET", IsHidden = true)]public class GetDashboardPackage{public string Mode { get; set; }}- [Route("/robots.txt", "GET")]+ [Route("/robots.txt", "GET", IsHidden = true)]public class GetRobotsTxt{}@@ -61,7 +61,7 @@ namespace MediaBrowser.WebDashboard.Api/// <summary>/// Class GetDashboardResource/// </summary>- [Route("/web/{ResourceName*}", "GET")]+ [Route("/web/{ResourceName*}", "GET", IsHidden = true)]public class GetDashboardResource{/// <summary>@@ -76,7 +76,7 @@ namespace MediaBrowser.WebDashboard.Apipublic string V { get; set; }}- [Route("/favicon.ico", "GET")]+ [Route("/favicon.ico", "GET", IsHidden = true)]public class GetFavIcon{}diff --git a/SharedVersion.cs b/SharedVersion.csindex 2798973492..e851e64880 100644--- a/SharedVersion.cs+++ b/SharedVersion.cs@@ -1,3 +1,3 @@using System.Reflection;-[assembly: AssemblyVersion("3.2.30.16")]+[assembly: AssemblyVersion("3.2.30.17")]