From 335ec27edc49243fa4310ebc1cec414c01dc0ab4 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 11 Sep 2017 14:49:20 -0400 Subject: [PATCH 1/3] update themes --- MediaBrowser.Server.Mono/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.cs index 04298e325..566a84da2 100644 --- a/MediaBrowser.Server.Mono/Program.cs +++ b/MediaBrowser.Server.Mono/Program.cs @@ -127,10 +127,10 @@ namespace MediaBrowser.Server.Mono var task = appHost.Init(initProgress); - appHost.ImageProcessor.ImageEncoder = ImageEncoderHelper.GetImageEncoder(_logger, logManager, fileSystem, options, () => appHost.HttpClient, appPaths, environmentInfo); - Task.WaitAll(task); + appHost.ImageProcessor.ImageEncoder = ImageEncoderHelper.GetImageEncoder(_logger, logManager, fileSystem, options, () => appHost.HttpClient, appPaths, environmentInfo); + Console.WriteLine("Running startup tasks"); task = appHost.RunStartupTasks(); From 95084d6f7d03594b1d4939067609d0065e08d606 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 11 Sep 2017 14:50:00 -0400 Subject: [PATCH 2/3] update dlna play to device timeout --- Emby.Dlna/PlayTo/Device.cs | 2 +- Emby.Dlna/PlayTo/PlayToController.cs | 18 +----------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/Emby.Dlna/PlayTo/Device.cs b/Emby.Dlna/PlayTo/Device.cs index 5a63be304..b6b1c0c03 100644 --- a/Emby.Dlna/PlayTo/Device.cs +++ b/Emby.Dlna/PlayTo/Device.cs @@ -113,7 +113,7 @@ namespace Emby.Dlna.PlayTo private int GetInactiveTimerIntervalMs() { - return Timeout.Infinite; + return 60000; } public void Start() diff --git a/Emby.Dlna/PlayTo/PlayToController.cs b/Emby.Dlna/PlayTo/PlayToController.cs index e8d7c9127..95b164212 100644 --- a/Emby.Dlna/PlayTo/PlayToController.cs +++ b/Emby.Dlna/PlayTo/PlayToController.cs @@ -48,23 +48,7 @@ namespace Emby.Dlna.PlayTo { get { - var lastDateKnownActivity = _creationTime > _device.DateLastActivity ? _creationTime : _device.DateLastActivity; - - if (DateTime.UtcNow >= lastDateKnownActivity.AddSeconds(120)) - { - try - { - // Session is inactive, mark it for Disposal and don't start the elapsed timer. - _sessionManager.ReportSessionEnded(_session.Id); - } - catch (Exception ex) - { - _logger.ErrorException("Error in ReportSessionEnded", ex); - } - return false; - } - - return _device != null; + return !_disposed && _device != null; } } From 2f99a78230b397535d7ea0b9e335a00b438379b4 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 11 Sep 2017 15:25:13 -0400 Subject: [PATCH 3/3] 3.2.30.17 --- .../Services/ServiceController.cs | 2 +- .../Services/ServicePath.cs | 6 +++++- .../Services/SwaggerService.cs | 14 ++++++++++---- MediaBrowser.Api/PluginService.cs | 10 +++++----- MediaBrowser.Model/Services/RouteAttribute.cs | 4 ++++ MediaBrowser.WebDashboard/Api/DashboardService.cs | 8 ++++---- SharedVersion.cs | 2 +- 7 files changed, 30 insertions(+), 16 deletions(-) diff --git a/Emby.Server.Implementations/Services/ServiceController.cs b/Emby.Server.Implementations/Services/ServiceController.cs index 4dc14a193..3fd6d88f8 100644 --- a/Emby.Server.Implementations/Services/ServiceController.cs +++ b/Emby.Server.Implementations/Services/ServiceController.cs @@ -75,7 +75,7 @@ namespace Emby.Server.Implementations.Services var 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.cs index df5d71374..0ca36df19 100644 --- a/Emby.Server.Implementations/Services/ServicePath.cs +++ b/Emby.Server.Implementations/Services/ServicePath.cs @@ -51,6 +51,8 @@ namespace Emby.Server.Implementations.Services public 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.Services return list; } - public RestPath(Func createInstanceFn, Func> getParseFn, Type requestType, string path, string verbs, string summary = null) + public RestPath(Func createInstanceFn, Func> 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.cs index 63cbb78dd..be3b4cbba 100644 --- a/Emby.Server.Implementations/Services/SwaggerService.cs +++ b/Emby.Server.Implementations/Services/SwaggerService.cs @@ -21,7 +21,7 @@ namespace Emby.Server.Implementations.Services public string host { get; set; } public string basePath { get; set; } public SwaggerTag[] tags { get; set; } - public Dictionary> paths { get; set; } + public IDictionary> paths { get; set; } public Dictionary definitions { get; set; } } @@ -147,16 +147,21 @@ namespace Emby.Server.Implementations.Services return new Dictionary(); } - private Dictionary> GetPaths() + private IDictionary> GetPaths() { - var paths = new Dictionary>(); + var paths = new SortedDictionary>(); - 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.Services result[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.cs index f6efe15e6..1eea89431 100644 --- a/MediaBrowser.Api/PluginService.cs +++ b/MediaBrowser.Api/PluginService.cs @@ -82,7 +82,7 @@ namespace MediaBrowser.Api /// /// Class GetPluginSecurityInfo /// - [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 { @@ -91,13 +91,13 @@ namespace MediaBrowser.Api /// /// Class UpdatePluginSecurityInfo /// - [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.Api public 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 { @@ -116,7 +116,7 @@ namespace MediaBrowser.Api public 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.cs index 5a39688da..264500e60 100644 --- a/MediaBrowser.Model/Services/RouteAttribute.cs +++ b/MediaBrowser.Model/Services/RouteAttribute.cs @@ -88,6 +88,10 @@ namespace MediaBrowser.Model.Services /// public string Summary { get; set; } + public string Description { get; set; } + + public bool IsHidden { get; set; } + /// /// Gets or sets longer text to explain the behaviour of the route. /// diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index c6bbca672..d4d0e281e 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -47,13 +47,13 @@ namespace MediaBrowser.WebDashboard.Api public 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 /// /// Class GetDashboardResource /// - [Route("/web/{ResourceName*}", "GET")] + [Route("/web/{ResourceName*}", "GET", IsHidden = true)] public class GetDashboardResource { /// @@ -76,7 +76,7 @@ namespace MediaBrowser.WebDashboard.Api public string V { get; set; } } - [Route("/favicon.ico", "GET")] + [Route("/favicon.ico", "GET", IsHidden = true)] public class GetFavIcon { } diff --git a/SharedVersion.cs b/SharedVersion.cs index 279897349..e851e6488 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")]