Mark plugin failure on DI Loop.

pull/4709/head
Greenback 4 years ago
parent d2d45295fc
commit 494ace7984

@ -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.");
}

@ -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
/// <returns>A <see cref="PackageInfo"/> containing package information.</returns>
[HttpGet("Packages/{name}")]
[ProducesResponseType(StatusCodes.Status200OK)]
[Produces(JsonDefaults.CamelCaseMediaType)]
public async Task<ActionResult<PackageInfo>> GetPackageInfo(
[FromRoute, Required] string name,
[FromQuery] Guid? assemblyGuid)
@ -72,6 +71,7 @@ namespace Jellyfin.Api.Controllers
/// <returns>An <see cref="PackageInfo"/> containing available packages information.</returns>
[HttpGet("Packages")]
[ProducesResponseType(StatusCodes.Status200OK)]
[Produces(JsonDefaults.CamelCaseMediaType)]
public async Task<IEnumerable<PackageInfo>> GetPackages()
{
IEnumerable<PackageInfo> packages = await _installationManager.GetAvailablePackages().ConfigureAwait(false);
@ -146,6 +146,7 @@ namespace Jellyfin.Api.Controllers
/// <returns>An <see cref="OkResult"/> containing the list of package repositories.</returns>
[HttpGet("Repositories")]
[ProducesResponseType(StatusCodes.Status200OK)]
[Produces(JsonDefaults.CamelCaseMediaType)]
public ActionResult<IEnumerable<RepositoryInfo>> GetRepositories()
{
return _serverConfigurationManager.Configuration.PluginRepositories;

Loading…
Cancel
Save