From 494ace7984edab77df7f9da30e411d8d3d617036 Mon Sep 17 00:00:00 2001 From: Greenback Date: Mon, 14 Dec 2020 23:39:47 +0000 Subject: [PATCH] Mark plugin failure on DI Loop. --- Emby.Server.Implementations/ApplicationHost.cs | 5 +++++ Jellyfin.Api/Controllers/PackageController.cs | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index f88c6c6208..8df1ec3008 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -406,6 +406,11 @@ namespace Emby.Server.Implementations Logger.LogError("Called from: {stack}", entry.FullName); } + if (type is IPlugin) + { + _pluginManager.FailPlugin(type.Assembly); + } + throw new ExternalException("DI Loop detected."); } diff --git a/Jellyfin.Api/Controllers/PackageController.cs b/Jellyfin.Api/Controllers/PackageController.cs index d139159aa0..459e68da78 100644 --- a/Jellyfin.Api/Controllers/PackageController.cs +++ b/Jellyfin.Api/Controllers/PackageController.cs @@ -2,9 +2,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; -using System.Net.Mime; using System.Threading.Tasks; -using Jellyfin.Api.Attributes; using Jellyfin.Api.Constants; using MediaBrowser.Common.Json; using MediaBrowser.Common.Updates; @@ -46,6 +44,7 @@ namespace Jellyfin.Api.Controllers /// A containing package information. [HttpGet("Packages/{name}")] [ProducesResponseType(StatusCodes.Status200OK)] + [Produces(JsonDefaults.CamelCaseMediaType)] public async Task> GetPackageInfo( [FromRoute, Required] string name, [FromQuery] Guid? assemblyGuid) @@ -72,6 +71,7 @@ namespace Jellyfin.Api.Controllers /// An containing available packages information. [HttpGet("Packages")] [ProducesResponseType(StatusCodes.Status200OK)] + [Produces(JsonDefaults.CamelCaseMediaType)] public async Task> GetPackages() { IEnumerable packages = await _installationManager.GetAvailablePackages().ConfigureAwait(false); @@ -146,6 +146,7 @@ namespace Jellyfin.Api.Controllers /// An containing the list of package repositories. [HttpGet("Repositories")] [ProducesResponseType(StatusCodes.Status200OK)] + [Produces(JsonDefaults.CamelCaseMediaType)] public ActionResult> GetRepositories() { return _serverConfigurationManager.Configuration.PluginRepositories;